[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: cmm.png (10 KB, 512x512)
10 KB
10 KB PNG
What would a language that seats between Assembly and C would look like? Should it look more like C-- or ASM++?
Would materializing certain concepts such as cache lines instead of variables (or stack frame being explicit instead of being implicit) within the language itself would force programmers to finally accept the cold reality of their hardware constraints?
It seems like the only way to save the software industry from being a gigantic pile of bloated crapwares at this point.
>>
FASM
has functions and loops
>>
>>100127322
B?
>>
>>100127322
Seems like an interesting and fun project op. Why don't you make a poc?
>>
>>100127322
Like Fortran?
>>
Anything higher than a macro assembler is bloat and will hide details of your CPU, period. The concept of portable assembly is a fucking meme.
>>
>>100127544
Even assembler hides details of your CPU like caching, pipelining, microcode, ....
>>
There are already llvm IR and this https://c9x.me/compile/ and many more.
Also c-- is the IR for the haskell compiler?
>>
>>100127497
collecting ideas probably
>>
>>100127322
It's called zig
>>
>>100127636
i don't think you read OP post properly
>>
>>100127636
zig is more like C+ than C--
>>
>>100127322
>Would materializing certain concepts such as cache lines
Are not exposed to developers. They're managed entirely by the CPU for a reason anon.

>or stack frame being explicit instead of being implicit
The worst and most error prone boilerplate. It would be retarded to require direct manipulation of this outside of assembler.

> It seems like the only way to save the software industry from being a gigantic pile of bloated crapwares at this point.
Saving the industry would require actually having standards for software engineering. Which would mean
>h1b terminated, pajeets go home
>offshoring terminated
>"coders" required to actually show an understanding of computer architecture
>>
So pretty much C without libc?
>>
>>100127693
What if you had to explicitly type "cacheLine." in front of all your variables ("cacheLine.variableName") to remind you at all the time that you are dealing with a cache line and not just a single variable? The preprocessor could remove it before compilation.
>>
>>100127322
seems pretty useless honnetement. you either want to precisely control what macroinstructions the cpu is running or you just want to write something reasonably fast and close to the hardware. i don't see the point of something in between.
>>
>>100127841
C is a high level language by the way
>>
>>100127322
>Would materializing certain concepts such as cache lines instead of variables
But ASM doesn't give you that either?
>>
>>100127865
okay? how does this invalidate any of what I said? C sits at a very sweet spot of abstraction. its features (functions, structs, structured control flow constructs) map very cleanly onto hardware.
>>
>>100127693
>>100127836
>explicitly
stack.push(arg1, arg2, arg3, arg4)
call function_name(stack.last)
>>
>>100127322
xolatile (hes a name fag from /gedg/ && /chad/) is already working on it
>>100127841
yeah, seems like a turing-tarpit
>>100127865
meaningless statement, "high level" only has meaning in relation to something. compared to ASM? yes. compared to javascript? no.
>>
>>100127932
>abstraction
that's the keyword here, i think what OP wants is a fully explicit C, where stack, cache line and so on are explicitly written down. No implicit things allowed at all.
>>
>>100128040
Why would you even bother with stack frames at this level of programmation? Just go stackless.
>>
>>100128008
>meaningless statement, "high level" only has meaning in relation to something. compared to ASM? yes. compared to javascript? no.
Relative to the time C language was created.
At the time C was created (and you weren't born), javascript wouldn't exist for another 23 years.
And that's for the first version of javascript, not talking about modern ECMA (2015).
Quite embarrassing to see C and Javascript being compared in that context honestly.
>>
MASM
>>
LLVM IR.
>>
>>100127322
https://en.wikipedia.org/wiki/C--
>>
>>100128101
>Why would you even bother with stack frames at this level of programmation? Just go stackless.
It's not so much about the "level of abstractness" but about what is implicit vs explicit.
>>
FowardCom
https://www.forwardcom.info/
>>
>>100128160
>Relative to the time C language was created.
have fun coding in the 4th dimension
>>
File: 8-cell-simple.gif (687 KB, 256x256)
687 KB
687 KB GIF
>>100128364
i believe someone is making a game called "Miegakure" and he is having fun coding in the 4th dimension
>>
>>100127322
It would look like assembly with macros and maybe control structures like MASM has. C has nothing to do with it.

>>100128160
>Relative to the time C language was created.
>At the time C was created (and you weren't born), javascript wouldn't exist for another 23 years.
Lisp already existed for 14 years. Simula 67, Algol 68, Prolog and Smalltalk are older than C.
>>
>>100128008
>xolatile
that guy hasnt completed a single project yet
>>
>>100129033
>Prolog older than C
you outed yourself zoomer
>>
>>100129119
correct. we are in good terms to and ive have been bulling him about it for a while. and wouldnt you know, he has been working on his game for months now - self admittedly the longest he ever has.
>>
>>100129241
saw his updates on /gedg/
>self admittedly the longest he ever has
good for him, I'll rather bully pixDAIZ now
>>
>>100128040
>stack, cache line and so on are explicitly written down
he can write it down explicitly all he wants, the compiler will simply ignore it because it has no way to communicating this to the machine. he can get his dream language with
#define stack /*haha*/
#define cacheline /*retard*/
>>
>>100127322
It should have a good built in library like python does.

It should have C syntax, you should make it optional whether to use types or not. Get rid of hackery with memory and pointers. Make it less of a pain to allocate or deallocate memory optionally also add automatic allocation so you can forget about memory.

Must be compiled, execution needs to be equal to C or close to ASM in terms of speed. Optionally have an interpreter for lazyfags and quick testing.

Add cool features like not getting castrated when you try to return an array from a function, like in python, dicts, all the nice things from built in sys lib

MUST HAVE A GOOD, SANE, FUNCTIONAL PACKAGE MANAGER

simply it needs to be python for white men
>>
File: Early_Prolog_timeline.png (79 KB, 1004x370)
79 KB
79 KB PNG
>>100129155
If that's wrong, edit Wikipedia.
https://en.wikipedia.org/wiki/Prolog#History
>The name Prolog was chosen by Philippe Roussel, at the suggestion of his wife, as an abbreviation for programmation en logique (French for programming in logic).[77] It was created around 1972 by Alain Colmerauer with Philippe Roussel, based on Robert Kowalski's procedural interpretation of Horn clauses. It was motivated in part by the desire to reconcile the use of logic as a declarative knowledge representation language with the procedural representation of knowledge that was popular in North America in the late 1960s and early 1970s. According to Robert Kowalski, the first Prolog system was developed in 1972 by Colmerauer and Phillipe Roussel.[78][79][80] The first implementation of Prolog was an interpreter written in Fortran by Gerard Battani and Henri Meloni.
>>
https://github.com/Thomas-de-Bock/construct/
you are welcomed baby ;)
>>
>>100127322
Shouldn't it be ASM++ instead?
>>
>>100130009
>same year as C
take you L dude
>>
>>100127322
Arduino language.
>>
>>100129374
>it has no way to communicating this to the machine
>esp ebp registers
>>
>>100129993
OP: thanks for your inputs
>>
>>100129993
>>100130635
lmao fucking retards
>OP: I want a language with no cache, no stack frames management, even lower level than ASM
>retard #2: woaw so just like Python
>OP: exactly!
>>
isn't this basically D without the libc dependency?
>>
>>100130987
The only similarity between D and assembly is that D allows you to provide assembly blocks, just like C++. As a matter of fast, D is pretty much C++ in a parallel timeline. OP wants something that enforces very low-level programming, not simply allow it.
>>
>>100131167
are you autistic? How can you fall for bait this weak?
>>
>>100127322
B was the predecessor to C
>>
>>100130907
What is the problem anon?

Python is amazing but it's slow and bloated, Csexsex would be a nice balance.
>>
>>100131619
You can't want a language that does nothing implicit and the Python standard library and returning arrays from functions at the same time, dingus.
>>
>>100131971
yes you can, why not
>>
abstracting assembly is a slippery slope that always leads to python
>>
>>100130567
>>meaningless statement, "high level" only has meaning in relation to something. compared to ASM? yes. compared to javascript? no.
>Relative to the time C language was created.
>>same year as C
C shills always BTFO themselves.
>>
>>100127322
You don't directly manipulate cache lines in assembly either and a language that can do everything is still going to btfo your C--, since you can always do inline assembly/intrinsics for extremely hot code, which none of you are actually writing.
>>
>>100127836
>What if you had to explicitly type "cacheLine." in front of all your variables
Then the cache wouldn't work worth a shit. Do you not understand that there are hundreds of processes and thousands of threads running on your computer right now? Go open Activity Monitor (macOS), Task Manager (Windows), or use the top command (Linux). See all those fucking processes? That's why the CPU manages the cache and not you.

>to remind you at all the time that you are dealing with a cache line and not just a single variable?
LOL I thought you were looking for explicit cache control. Instead your idea is even more silly. If you're writing high performance code you don't need to be reminded about cache behavior. People who don't know how to write such code won't even think about "cacheLine" it will just be there because it was in the code they copied from StackOverflow.

Here you go:
https://people.freebsd.org/~lstewart/articles/cpumemory.pdf

That article can damn near be summed up as:
>use contiguous memory so the prefetch works
Of course that simple advice fails in most languages because those languages scatter data structures across RAM and the programmer cannot control this. The best language for taking advantage of that PDF is C. Not even C++ or Rust because even those tempt you to do things that scatter data structures across RAM. Though if you can resist the temptation then you can optimize for cache like you can in C.
>>
>>100127972
>boilerplate
If you need to control the stack it's literally time for assembler. 99.99% of code would gain no benefit from forcing the programmer to think about it.
>>
>>100127322
Fortran gets close to that idea
but be honest most of you have never written a line of assembly in your lines
>>
>>100127322
>lot of anti-C-mitism in this thread
>>
>>100133271
I knew you wouldn't get it.
>>
>>100127322
B
>>
>>100133284
>no benefit from forcing the programmer to think about it.
clearly the benefit IS to think about it, did you even read the post?
>>
File: Oh wait you're serious.gif (1.13 MB, 288x198)
1.13 MB
1.13 MB GIF
>>100127322
>It seems like the only way to save the software industry from being a gigantic pile of bloated crapwares at this point.
Bet you $100 it won't.
>>
https://llvm.org/docs/LangRef.html

here you go
>>
>>100135020
I do get it, you just don't like the answer.
>Would materializing certain concepts such as cache lines instead of variables (or stack frame being explicit instead of being implicit) within the language itself would force programmers to finally accept the cold reality of their hardware constraints?
No, it would not.
>>
>>100136451
to be fair most people replying here are probably unemployed web coders and should abstain from real programming discussions
>>
F O R T H

A simple subroutine-threaded forth interpreter/compiler system has better power-to-weight ratio than any dumb overcomplex language you're thinking of. Any forth worth its salt has an assembly wordset. Add a sprinkle of TCE and keep TOS in a register and you have most of the fast you want in a handful of kilobytes.
>>
It seems to be a programming language for sadists.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.