51
submitted 7 months ago* (last edited 7 months ago) by aldalire@lemmy.dbzer0.com to c/chapotraphouse@hexbear.net

Seriously. There’s so many floating around. It feels like there’s a cycle of

Random programmer thinks xyz language sucks -> she/he makes a slightly different, slightly faster, slightly more secure version -> by luck this gains mass adoption-> random programmer thinks new xyz language sucks

I propose when the revolution comes and the last guillotine falls we decide a general-purpose programming language that coders should stick to. I vote Lisp or any of the dialects (scheme, clojure, racket), but i also feel something about the Julia language for scientific research. Maybe we can decriminalize using C. Absolutely ban and hunt down the use of any of the hipster languages teenagers are into these days.

Nim? Zig? Crystal?? I am absolutely losing my damn mind. It compiles to bytecode people. Make up ur damn minds. To jail with all of u

you are viewing a single comment's thread
view the rest of the comments
[-] InevitableSwing@hexbear.net 3 points 7 months ago

compiler tower

Could I get a ELI5?

I googled but doing that made me more confused.

[-] thetaT@hexbear.net 5 points 7 months ago

https://www.gnu.org/software/guile/manual/html_node/Compiler-Tower.html

Guile’s compiler is quite simple – its compilers, to put it more accurately. Guile defines a tower of languages, starting at Scheme and progressively simplifying down to languages that resemble the VM instruction set (see Instruction Set).

Each language knows how to compile to the next, so each step is simple and understandable. Furthermore, this set of languages is not hardcoded into Guile, so it is possible for the user to add new high-level languages, new passes, or even different compilation targets.

Let's use the tower metaphor for a moment. Consider Scheme:

Scheme
   |
   |
   v
Tree Intermediate Language (Tree-IL)
   |
   |
   v
Continuation-Passing Style (CPS)
   |
   |
   v
Bytecode

To compile Scheme to Bytecode, it's lowered through different stages until it's Bytecode.

We can also decompile, and raise code instead of lowering it - for example, here's how Guile-JavaScript works, which compiles Scheme to JavaScript, by first lowering Scheme to Tree-IL, then raising that Tree-IL to JavaScript through decompilation.

Scheme         JavaScript
  |                ^
  |                |
  v                |
Tree Intermediate Language (Tree-IL)

We take code through the tower to transform it into its desired form.

Hope this made sense. Or maybe it confused you even more =).

[-] Thordros@hexbear.net 2 points 7 months ago* (last edited 7 months ago)

Sounds made up. Guile is only good for flash kicks and sonic booms.

this post was submitted on 27 Mar 2024
51 points (100.0% liked)

chapotraphouse

13519 readers
983 users here now

Banned? DM Wmill to appeal.

No anti-nautilism posts. See: Eco-fascism Primer

Gossip posts go in c/gossip. Don't post low-hanging fruit here after it gets removed from c/gossip

founded 3 years ago
MODERATORS