this post was submitted on 27 Mar 2024
47 points (98.0% liked)

chapotraphouse

13473 readers
1 users here now

Banned? DM Wmill to appeal.

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

Vaush posts go in the_dunk_tank

Dunk posts in general go in the_dunk_tank, not here

Don't post low-hanging fruit here after it gets removed from the_dunk_tank

founded 4 years ago
MODERATORS
 

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

top 50 comments
sorted by: hot top controversial new old
[–] CommieCretzl@hexbear.net 40 points 1 year ago (1 children)

After the revolution we should unify fasteners. There's just too many. Nails? Screws? Glue? Velcro? It's all an illusion of choice because they do the same thing anyways. We'll need to pick one, and I'm thinking staples.

[–] oscardejarjayes@hexbear.net 3 points 1 year ago

Epoxy is peak, time to split the political party again

[–] volcel_olive_oil@hexbear.net 37 points 1 year ago (1 children)

When the revolution comes we need to unify tools

Hammer? Screwdriver? Spanner? One of these should be enough

[–] ProfessorOwl_PhD@hexbear.net 15 points 1 year ago

Single handle with interchangeable heads.

[–] citrussy_capybara@hexbear.net 36 points 1 year ago (2 children)
[–] hotcouchguy@hexbear.net 29 points 1 year ago (3 children)

All these cutting edge new languages are just wrappers around the same C libraries some anonymous grad students wrote in the 70s funded by some tiny government grants.

[–] RussianEngineer@hexbear.net 23 points 1 year ago

"You could not live with your own failure. Where did that bring you? Back to C."

[–] RedWizard@hexbear.net 16 points 1 year ago (1 children)

All these cutting edge new languages are just wrappers around the same assembly code by Kathleen Booth in the 1940s for her university computer.

load more comments (1 replies)
[–] PaX@hexbear.net 3 points 1 year ago* (last edited 1 year ago)

Programming languages and operating systems are really best developed together tbh

Otherwise you end up building an new, extremely unimaginative operating system into your programming language that is usually permanently linked with the operating system you developed it with anyway

[–] FunkyStuff@hexbear.net 27 points 1 year ago (4 children)
[–] SkingradGuard@hexbear.net 5 points 1 year ago (1 children)
[–] FunkyStuff@hexbear.net 5 points 1 year ago

Rust got trans women's seal of approval, that's how you know it's the real deal.

[–] TheDoctor@hexbear.net 4 points 1 year ago
load more comments (1 replies)
[–] Erika3sis@hexbear.net 20 points 1 year ago (1 children)
load more comments (1 replies)
[–] Tabitha@hexbear.net 20 points 1 year ago

Can we ban all tools that aren't hammers while we are here?

[–] TheDoctor@hexbear.net 15 points 1 year ago

Language design and theory has made some legitimate gains over the past couple decades. And different languages have different strengths suited for different problems. I think the issue is that even people who agree with this aren’t gonna agree on the language to standardize on. It’s the XKCD comic.

[–] Feinsteins_Ghost@hexbear.net 15 points 1 year ago (2 children)

After the revolution we should just unify english. Theres so many spoken languages around.

[–] Erika3sis@hexbear.net 14 points 1 year ago

Hearies when there's more than one sign language type beat

[–] thetaT@hexbear.net 2 points 1 year ago (2 children)

Lojban. We make Lojban the international language.

load more comments (2 replies)
[–] Adkml@hexbear.net 12 points 1 year ago (2 children)

there are 28 coding languages

"We need to invent a universal language that brings all these together so everybody can just use one"

there are 29 coding languages

[–] PaX@hexbear.net 4 points 1 year ago* (last edited 1 year ago) (1 children)

There's a lot of languages but people usually have a favorite that probably isn't very unique lol

There's no such thing as a universal language but we can build better languages (and operating systems) that dominate

load more comments (1 replies)
load more comments (1 replies)
[–] FourteenEyes@hexbear.net 11 points 1 year ago (1 children)

And then we can use our unified programming language to write a program so tall it breaches Heaven itself

[–] aldalire@lemmy.dbzer0.com 2 points 1 year ago

I swear my personal conspiracy theory is that corporations like to introduce flashy new programming languages to divide programmers so they don't get too powerful for their own britches and rise up against the executives that control them.

Imagine if there was a single, unified programming language, used both in industry, research and for hobbyists. Then we can standardize all of tech

[–] silent_water@hexbear.net 8 points 1 year ago (1 children)

learn more languages - it makes the code you write more effective on the human level. like learning Haskell taught me how to conceive of ideas that you would just solve by duplicating code or building a shitty interface that falls apart when you need to combine it with anything else. code is math and code is a means by which you communicate with other people. and you need to learn to express yourself in more ways in order to come to a deeper understanding of both of those facets.

I don't want fewer languages. I want more diversity and more experimentation. I'd love to see more domain-specialized languages that borrow ideas from the more academic languages and refine them. look at Elm and how much ground it broke - so much so that it's impacted how new javascript UI frameworks are designed. but Elm couldn't exist without languages like Haskell and Ocaml. and those couldn't exist without ML, Miranda, etc, etc.

putting limits on human creativity defeats the entire purpose of the left. we dream of being unshackled, of the genuine freedom that can only come from the defeat of capitalism and the dawn of a new, socialist political economy. perhaps if one day I write a better Lean, it will inspire someone to write a web language that brings proofs into the developers' lexicon and we will all have less shitty, poorly conceived, brittle code to maintain. and maybe you'll inspire me with a great idea of your own.

load more comments (1 replies)
[–] thetaT@hexbear.net 6 points 1 year ago* (last edited 1 year ago) (10 children)

I like Guile with its compiler tower. You can use multiple languages on the same VM, even using libraries from one language on another, which is fucking cool. The core language for Guile is Scheme, and it supports standards from R4RS-R7RS, along with plenty of built-in SRFIs, some implemented out-of-tree and many of its own Guile-specific extensions.

For the compiler tower, so far we've got the aforementioned ballin' Scheme implementation, Emacs Lisp, an unfinished JavaScript implementation that doesn't even fully implement ES3, Brainfuck, Python, wonky Lua, and Guile-specific Clojure. Hopefully there's more to come and there's some I missed.

While the main purpose for the compiler tower is to lower a language into the IR (Tree-IL) (although you can lower a language into another language too, which then itself can be lowered into IR), which gets lowered to more verbose IR (CPS), then bytecode - we can also raise IR through decompilation. For example, Guile-JavaScript compiles Scheme to IR, then decompiles the IR and raises it to JavaScript.

Then there's also Guile Hoot, which I believe lowers the IR into WASM. In theory, when its complete, the above languages could work with Hoot and he compiled to Hoot, but I'm not entirely sure on this.

[–] InevitableSwing@hexbear.net 3 points 1 year ago (1 children)

compiler tower

Could I get a ELI5?

I googled but doing that made me more confused.

[–] thetaT@hexbear.net 5 points 1 year ago (1 children)

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 =).

load more comments (1 replies)
load more comments (9 replies)
[–] oscardejarjayes@hexbear.net 5 points 1 year ago
[–] PaX@hexbear.net 5 points 1 year ago* (last edited 1 year ago) (4 children)

Yeah literally mostly all I want is a better C with less weird quirks and undefined behavior, may as well drop null-terminated strings except for compatibility too, maybe some kind of memory-safety mechanism too, ooh also better support for multi-dimensional arrays

Rust was kinda like that until it became the better C++

Maybe in 10 years someone will be designing a better Rust because they made the same mistakes of C++ and forced so much shit into it it's extremely difficult to write any new, better implementations and port to new systems

[–] TrashGoblin@hexbear.net 2 points 1 year ago

Zig and Hare are both vying for the better-C category these days.

load more comments (3 replies)
[–] BigHaas@hexbear.net 5 points 1 year ago

Terrible take tbh

You can pry Julia out of my cold dead hands but if you make me work with other people in it I'll start sobbing

[–] SpiderFarmer@hexbear.net 3 points 1 year ago

In my communist future it's all Torqur3D, Python, and BASIC. No, I do not know any of those.

[–] LaForgeRayBans@hexbear.net 3 points 1 year ago

Banning programming languages seems like a bad idea to me, humanity has come to regret all that language standardization and cultural genocide that happened with the imposition of one universal linguistic language. My official (so the communist position) on programming languages is let a thousand alternates to C+ bloom, then crush them all under the jackboot of the communist party. THEY WILL ALL BE THE LANGUAGE OF COMMUNISM!

[–] Lemmygradwontallowme@hexbear.net 2 points 1 year ago (1 children)

I'm only familiar with Python...

[–] aldalire@lemmy.dbzer0.com 6 points 1 year ago (1 children)

Python will be outlawed unfortunately.

load more comments (1 replies)
[–] xj9@hexbear.net 2 points 1 year ago

Scheme , BQN and SED used to make a really nice OCaML p compiler

[–] TrashGoblin@hexbear.net 2 points 1 year ago (2 children)

Unless you are writing a hard-realtume system, Common Lisp is the only language you will ever need.

[–] space_comrade@hexbear.net 3 points 1 year ago* (last edited 1 year ago) (1 children)

Be quiet parentheses diddler, (((((()((((((())((do-thing (())(())))))0((( who the fuck wants to look at that all day.

But seriously tho how do you get used to the syntax? I've read some moderately complex Lisp code and it was very hard to read for me, do you just kinda get used to it over time or is there extra tooling involved?

[–] aldalire@lemmy.dbzer0.com 3 points 1 year ago* (last edited 1 year ago) (1 children)

OK fair point actually. You just gotta write some lisp code yourself (I'm a fairly new lisper although I had emacs for a while now and have dabbled in some elisp to edit my config) to appreciate how the parentheses are actually helpful when you write things. To read things, well-written lisp code will be properly indented, or else a reasonably powerful editor (emacs with sly, etc) is able to indent the code for you

Take a look at my (shameless plug) eratosthenes sieve function i wrote just yesterday

(defun range (start end)
  (if (< start end)
      (cons start (range (1+ start) end))))

;; Checks if d is a factor of n
(defun factorofp (d n)
  (zerop (rem n d)))

;; Sieve in lisp??
(defun sieve (n)
  (let ((primes (range 2 n))
        (curprime 2))
    (maplist (lambda (tail)
               (delete-if (lambda (n)
                            (factorofp curprime n))
                          (cdr tail))
               (setf curprime (cadr tail)))
             primes)
    primes))

u don't have to understand it. But the general principle is, things that are indented at the same level are arguments to the same function. In other words, notice that the delete-if and the setf are indented together. So they must be part of the same "argument:" namely, the body of the anonymous function lambda. So really, you don't have to count the parentheses or anything. The indentation makes things clear and unambiguous.

Other things that aid in reading are, obviously, patterns that you pick up along the way. Do not fear the parentheses. Embrace them

[–] space_comrade@hexbear.net 3 points 1 year ago (1 children)

I can read it if I really focus but even with the nice indentation the syntax doesn't make it easy, it's probably way easier with proper syntax highlighting tho, whatever the Lemmy renderer did here seems wrong.

I still don't really see why I would suffer the syntax over using a more readable language, I've heard this syntax makes the macro system way more elegant/powerful but I can't see it being THAT much better than whatever other languages are doing.

load more comments (1 replies)
[–] PaX@hexbear.net 2 points 1 year ago

Never been a Lisp person but

Looking into this

load more comments
view more: next ›