4 ms·
One thing to look for are programs that use advanced techniques as opposed to programs that are just simply clear or well-commented. For instance, instead of
by PaulHoule 3y ago
One thing to look for are programs that use advanced techniques as opposed to programs that are just simply clear or well-commented. For instance, instead of learning a new programming language, you should learn how programming languages are made. Most of the secrets that computer science majors know that you probably don't were learned in compilers class.
(Unfortunately many people are chasing the Holy Grail of "functional programming" and never finding it because "functional programming" is a pale shadow of what's possible when you understand how compilers work: this is how Common LISP and scheme are so much more profound then, say, Haskell)
It's a little out of date but I was lately thinking up about the Scott Adams adventure games of the early 1980s that were written with a specialized interpreter which could be implemented in BASIC but was also implemented in assembly language for better performance. See
https://ahopeful.wordpress.com/2020/09/13/digging-up-adventureland-scott-adams-1980/ https://ahopeful.wordpress.com/2020/09/13/digging-up-adventu...
If you tried to implement a game like that directly in a language like BASIC you would be driven nuts because that kind of game is fundamentally "object oriented" in that there are a number of things like rooms and items that are all mostly the same except they are different in some ways and trying to code that with IF, THEN and ELSE is bad enough even before GOTO gets added to the mix. The thing is that GOTO becomes quite benign and even useful when it is used to implement interpreters.
So back in the day you would study systems like that to stretch your skills, today I would look at compilers and related technology, like the Jena rules engine.
- vore 3y ago> Unfortunately many people are chasing the Holy Grail of "functional programming" and never finding it because "functional programming" is a pale shadow of what's possible when you understand how compilers work: this is how Common LISP and scheme are so much more profound then, say, Haskell Huh? What does this even mean? Both languages are very different from each other and the only thing they really have in common is having functions — how is one more “profound” than the other or any less worthy of being “functional programming”, for whatever that means to you?
- intelVISA 3y agoI've never seen good code, but if it exists I am sure it'd be a lisp.
- PaulHoule 3y agoI've met a few young programmers who heard somewhere that object-oriented programming was bad and they want to get the enlightenment of functional programming that they've heard about. Frequently they travel from job to job like itinerant martial artists always looking for somewhere where they practice the true technique but they always seem disappointed as it is just as easy if not easier to screw up handling errors with monads than it is with exceptions and they find analogies like "a monad is like a burrito" just get them more confused. As for something profound I'd point you to https://github.com/cerner/clara-rules https://github.com/cerner/clara-rules which many people will struggle with because like many other production rules engines in LISP (and many other examples of simple compilers), there is hardly any code! Contrast that to the orders of magnitude larger rules engine Drools https://github.com/kiegroup/drools https://github.com/kiegroup/drools which is so crazy-complicated primarily because the Drools language is Java-based so you need all sorts of things that Clara or CLIPS don't need. Note that both of these systems use variations of this algorithm https://en.wikipedia.org/wiki/Rete_algorithm https://en.wikipedia.org/wiki/Rete_algorithm where a set of rules can be compiled to a network of transitions that can happen when facts are added to the knowledge base so it is very much an example of compiler technology. (That said, Drools supports a lot of features that Clara doesn't and also supports a very advanced RETE-like algorithm that can exploit parallelism that early versions couldn't.)
- eternityforest 3y agoWhat are these iternant code students trying to achieve with all this? Performance? Productivity? Lower defects? Safety critical code seems to still be usually in C/C++, for reasons having nothing to do with the language being safe. Why are these people not studying Erlang, MISRA C, Rust, some kind of formal proof solver language, or OpenCL? What do people aspire to one day work on that would make the Haskell or LISP more appealing than a more locked down, static checking, kind of language? Programming culture is more confusing than the code itself!
- _a_a_a_ 3y ago> and never finding it because "functional programming" is a pale shadow of what's possible when you understand how compilers work My area so I'm extremely interested - please elaborate