Programming thread -

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
UNHOLY MOTHER OF A THOUSAND YOUNG
All I got to show is the nanopass compiler, which is pretty cool - framework to encode languages and transformations in scheme. The idea is that compilation passes should do one thing and be well defined. Example on how you'd use it to generate C:
Just being able to drop into C code in the middle of scheme is the most boner inducing feature ever.

C is dogshit, but it rules the world in Unix (and probably elsewhere idk), so you might as well have convenient access to it.

Chicken's implementation of srfi-4 can also be passed in natively to C functions, which makes implementing opengl bindings super easy.

I should get back to fucking around with opengl, come to think of it...
 

Yotsubaaa

Eric Ciaramella is the whistleblower
kiwifarms.net
At the risk of sounding like moving the goalpost, I was referring to the lispers, not necessarily to lisp. When you start working with lisp you become a better programmer, even if you won't get a chance to use it in your daily tasks. If you do, you're lucky.
Absolutely. I was having a bit of fun in the Stallman thread, but there's nothing wrong with learning Lisp, or even preferring it. It's a truly impressive programming language, especially given how many of its useful features existed at its start over half a century ago.

That said, definitely don't be the cringy sort of Lisp programmer: the one that refuses to even work in other 'lowly' programming languages, and gets into gay internet fights about lambda calculus (yes, those guys exist).

And if you are going to be that sort of Lisp programmer, appreciate that there's going to be a smaller pool of programming jobs for you right from the start. So for example, definitely don't spend all your time viciously lighting up those few potential employers on Usenet if you want them to recommend you for a job, would be my advice.
 

Shoggoth

kiwifarms.net
Absolutely. I was having a bit of fun in the Stallman thread, but there's nothing wrong with learning Lisp, or even preferring it. It's a truly impressive programming language, especially given how many of its useful features existed at its start over half a century ago.

That said, definitely don't be the cringy sort of Lisp programmer: the one that refuses to even work in other 'lowly' programming languages, and gets into gay internet fights about lambda calculus (yes, those guys ewerexist).

And if you are going to be that sort of Lisp programmer, appreciate that there's going to be a smaller pool of programming jobs for you right from the start. So for example, definitely don't spend all your time viciously lighting up those few potential employers on Usenet if you want them to recommend you for a job, would be my advice.
If one's enough of a turbo autist who wouldn't touch the "lowly" languages one should either be smart enough to use all the metaprogramming powers at one's disposal to do code generation or realize one's not as smart as one thought one was and STFU.
On the other hand, can you imagine being a SmugCeeWeenie in an organization which works in Lisp? If you thought lispers were annoying, "you should see the other guy"
 

Yotsubaaa

Eric Ciaramella is the whistleblower
kiwifarms.net
Like we said earlier, not every language is good at everything.

LISP is good at nothing nowadays (same as Haskell, COBOL, visual basic and Fortran), except toy projects and software history.
To be fair, Lisp has its good points. Especially for metaprogramming. There's something really neat about the code-data homoiconicity in Lisp that makes it seem like writing code that writes itself won't be a completely mind-numbing clusterfuck. (I'd much rather write macros in Lisp than in Julia, for instance, and don't even get me started on what some other languages think metaprogramming is).

As for Lisp relevance today, Clojure was doing some interesting things with concurrency the last time I looked at it. That seems like it will be useful with the way things are headed these days.

Oh and as for Fortran, that's (shockingly!) still kicking around. There's a truly disgusting amount of high-performance computation code for physics/math research that's still written in Fortran90. The reason for this I suspect is half inertia, and half that it's very straightforward to write efficient code in Fortran. While you can write code that is just as fast (and often faster) in C or C++, it typically requires a basic understanding of pointers and how not to have aliasing cripple your compiler optimizations. And (perhaps not shockingly,) many physics/math researchers can't program worth a damn.
 
Last edited:
  • Like
Reactions: ConcernedAnon

DNJACK

Part of the EDF communauty
True & Honest Fan
kiwifarms.net
I tried metaprogramming and worked on projects make extensive use of it. Turns out new team members will hate you for having defined a sublanguage they hate and will never understand completly. And it's impossible to get those sucky macros out of the code ever without rewriting everything.

Meta-programming is a long term support nightmare. Don't do that. In the age of web when a framework last 2 months it might not matter. Hopefully some day it will.

Lisp has clear advantages over others. Lots of languages were influenced by it, and every one tried to take as much as possible without bringing all the bad things with it. That's why it's not relevant anymore: you can get almost the same best case scenario than LISP while doing much better at what LISP struggle to do. Lisp was good at AI in the 70s. Now AI runs on gpu and asic and lisp doesn't run there.

Fortran usage is legacy. It might be getting the same performance as heavily optimized C on trivial functions, but parallelism is just horrible, and is one of the most important aspect of high performance computing nowadays. Even functions are a mess.
 

Yotsubaaa

Eric Ciaramella is the whistleblower
kiwifarms.net
Fortran usage is legacy. It might be getting the same performance as heavily optimized C on trivial functions, but parallelism is just horrible, and is one of the most important aspect of high performance computing nowadays. Even functions are a mess.
Agreed. And unfortunately I can see Fortran use staying legacy pretty much forever in scientific computing circles. Like I said: inertia. Particularly in HPC (and particularly in anything involving hydrodynamics), there's too much battle-hardened Fortran code out there that has been polished over the years to be 'good enough'. Yes, you could probably write "heavily optimized C" that would be much more efficient. But even assuming you could find a researcher with the necessary level of both mathematical and programming skill (again, most of them can't program worth a damn), most physics/math departments aren't going to fund such refactoring.

Your take about the horrible parallelism of Fortran intrigues me though. Care to elaborate?
 

Shoggoth

kiwifarms.net
I tried metaprogramming and worked on projects make extensive use of it. Turns out new team members will hate you for having defined a sublanguage they hate and will never understand completly. And it's impossible to get those sucky macros out of the code ever without rewriting everything.

Meta-programming is a long term support nightmare. Don't do that. In the age of web when a framework last 2 months it might not matter. Hopefully some day it will.

Lisp has clear advantages over others. Lots of languages were influenced by it, and every one tried to take as much as possible without bringing all the bad things with it. That's why it's not relevant anymore: you can get almost the same best case scenario than LISP while doing much better at what LISP struggle to do. Lisp was good at AI in the 70s. Now AI runs on gpu and asic and lisp doesn't run there.

Fortran usage is legacy. It might be getting the same performance as heavily optimized C on trivial functions, but parallelism is just horrible, and is one of the most important aspect of high performance computing nowadays. Even functions are a mess.
It's a good point regarding metaprogramming. It's a bit like drugs. It's nice to use a little bit. Can even be used medicinally, but then you get hooked use too much and ruin your life. It does have its place in writing libraries or frameworks, for example pattern matching or compilers, but otherwise macros shouldn't be too deeply indulged in.
I think the other pillars lisps stand on and weren't used enough back in the day were functional programming and polymorphism, which are gaps which have been closed by Clojure. It's truly functional and has many types of polymorphism which you can just apply as needed. It runs on the JVM so you get all its goodies, it avoids the metaprogramming nightmare, more readable, has first class reader support for other data types (vectors, maps, etc.), and has excellent concurrency semantics and libraries.
It's also extremely easy to implement other paradigms in it, so you have libraries which implement category theory concepts (monads, etc: fluokitten, cats), logic programming (core.logic), numerical computation (neanderthal), pattern matching (core.match, meander).
Yeah, you won't get C performance, but maybe one day it'll be ported to a systems' programming language, and you'll get pretty close.
 

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
CLOS is still one of two best oop models out there, the other being smalltalk's messaging model. CLOS is a more traditional class based oop model, though with the exception that it allows matching types based on all method arguments, not just the implicit 0th argument this. CLOS along with sexprs, are all the justification I'd need for using a lisp for complicated, hairy logic like game development or permissions systems in forums or similar situations.

CLOS isn't some elaborate mini language, but a well justified, readable oop system with plenty of theory behind it.

Or there's ssax, which is an sexpr syntax for html/xml. You can process it to expand custom terms into other terms, and then finally expand the whole thing into proper html/xml.

Again, not some fly-by-night custom language, but a version of html, except with a syntax that's actually readable and concise, and actually usable for something other than write-once/read-never.

If we want to talk about stupid custom languages, lisp isn't anywhere near the top. What about xslt? No one brings up xslt. It's a fucking programming language using XML syntax. Or what about yaml? Yaml is mostly not that bad, except when you need to embed a shell script or something in it and have to spend a bunch of time figuring out arcane escaping rules.

Or what about make? Did you know you can embed arbitrary scripts in makefiles? For any language with an interpreter?

Lisp isn't anywhere near the top of stupid custom, off-the-cuff language inventors. Not even close.
 
  • Informative
Reactions: Yotsubaaa

DNJACK

Part of the EDF communauty
True & Honest Fan
kiwifarms.net
That's all the justification you need to use it in a large project? I won't argue method matching with all arguments is not superior, but it's a minor point compared to developer familiarity, profilers and debugging tools, stability of libraries, etc...
Of course there's languages more stupid than LISP. But I've yet to see make evangelist trying to convince people that software enlightenment is just a game coded in COBOL away. Cut the bullshit, it's just a tool, and not a great one at that.
 

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
That's all the justification you need to use it in a large project? I won't argue method matching with all arguments is not superior, but it's a minor point compared to developer familiarity, profilers and debugging tools, stability of libraries, etc...
Of course there's languages more stupid than LISP. But I've yet to see make evangelist trying to convince people that software enlightenment is just a game coded in COBOL away. Cut the bullshit, it's just a tool, and not a great one at that.
It really isn't a minor point. Different programming languages are used because they're a mode of expression as well as a functional tool. Sure you'll write a program a few times, but you'll spend a lot more time reading the code than writing it, so having readable code is incredibly important. If it's "just a tool", then there's no reason to invent new languages in the first place.

Developer familiarity, profilers, debugging tools, libraries, etc are all important too. But more or less important depending on circumstances.

There's plenty of classes of projects I'd do in Scheme. And quite a few I wouldn't as well.
 
  • Like
Reactions: Yotsubaaa

Yotsubaaa

Eric Ciaramella is the whistleblower
kiwifarms.net
Hey @Marvin I found this while looking further into that Google quantum supremacy thing just now: the guys at Rigetti used Common Lisp to write their own quantum computing virtual machine, and an optimizing compiler for their Quil programming language for it.

 
  • Thunk-Provoking
  • Winner
Reactions: Shoggoth and Marvin
Tags
None

About Us

The Kiwi Farms is about eccentric individuals and communities on the Internet. We call them lolcows because they can be milked for amusement or laughs. Our community is bizarrely diverse and spectators are encouraged to join the discussion.

We do not place intrusive ads, host malware, sell data, or run crypto miners with your browser. If you experience these things, you have a virus. If your malware system says otherwise, it is faulty.

Supporting the Forum

How to Help

The Kiwi Farms is constantly attacked by insane people and very expensive to run. It would not be here without community support.

BTC: 1DgS5RfHw7xA82Yxa5BtgZL65ngwSk6bmm
ETH: 0xc1071c60Ae27C8CC3c834E11289205f8F9C78CA5
BAT: 0xc1071c60Ae27C8CC3c834E11289205f8F9C78CA5
LTC: LSZsFCLUreXAZ9oyc9JRUiRwbhkLCsFi4q
XMR: 438fUMciiahbYemDyww6afT1atgqK3tSTX25SEmYknpmenTR6wvXDMeco1ThX2E8gBQgm9eKd1KAtEQvKzNMFrmjJJpiino