God writes in Lisp

Certain intolerable flaws in Lisps are "fixed" in Clojure. Clojure is also more expressive than other Lisps.

Clojure is a Lisp-1 (like Scheme functions and data share the same namespace) whereas Common Lisp is a Lisp-2 (functions and data have a different namespace)
 
God writes typed racket.
Racket offers a number of interesting features not found in other languages, making it an attractive option for real-world work.

The #1 factor that determines programming productivity for many programmers is the set of data structures that are built-in to the language and if they are easy to work with.

Clojure gets data structures right. There's a good assortment of collection types built in: lists, lazy lists, vectors, hash tables, sets, sorted hash tables, sorted sets, and queues. All the built-in data structures are persistent/immutable. Even the vectors are persistent.


The two most intelligently designed programming languages, in my opinion, are Qi and Haskell.

Type systems are also important. They help prevent errors by ensuring that the data being used in a program is of the correct type.


Qi makes use of the logical notation of sequent calculus to define types. This type notation, under Qi's interpretation, is actually a Turing complete language in its own right.

I’m debating between Haskell and Clojure...

#1 I learnt Haskell. I haven't touched Clojure since.

#2 This matches my experience precisely.
I learned Java, C, Python, C++. Then I learned Clojure, and it was fun and beautiful and enlightening, but I could not tolerate dynamic typing after a while. Too many useless bugs.
Then I learned Haskell, and it took me around two days to realize I was done with Clojure. It made me remember why I used to love programming. It lets you build elegant things the right way.
 
Never, ever reference Reddit for anything requiring intelligent thought.

I do like clojure with its close tie to both Java and lisp. I am thinking of using it for my new project but am concerned about speed but rapid development and expansion seems to be quite compelling
 
Lisp isn't about writing and reading a program. Lisp is about keeping a program changeable.

The only way to keep a program changeable is to keep every assumption that you ever make during implementation in one code place. For anything complex that is only possible using compile-time computing. Generating code from that one definition of an assumption that you have into every code piece you need.


Lisp is also about reasonable turnaround times, where a turnaround is editing code, compiling it, linking it and running it. That needs to be fast because your brain holds context for no longer than (most specialist say) 7 seconds.
 
Lisp isn't about writing and reading a program. Lisp is about keeping a program changeable.
Speed is also an important feature of Lisp. Common Lisp is very fast for some specific things:
Chez Scheme is on average about as fast as Common Lisp.
Chez Scheme supports all standard features of Scheme, including first-class procedures, proper treatment of tail calls, continuations, user-defined records, libraries, exceptions, and hygienic macro expansion.
Chez Scheme also includes extensive support for interfacing with C and other languages, support for multiple threads possibly running on multiple cores, non-blocking I/O, and many other features.

But what is interesting, Qi is on average even faster than Common Lisp and Chez Scheme:
In fact, Qi is ahead of functional programming design in many of its features.
Its generally efficient, being faster in execution than hand-coded native CL and has all the features of the Lisp genotype while being about 3x more compact for programming purposes than CL.


I do like clojure with its close tie to both Java and lisp. I am thinking of using it for my new project but am concerned about speed but rapid development and expansion seems to be quite compelling
Compared to Python, Clojure is still fast:
Catacumba - Requests/sec: 30736.96
Aiohttp - Requests/sec: 13084.33
Clojure is among the very most productive languages ever developed, it is almost 3x more productive than Python.

Of course, the fact that it uses the JVM is also an advantage in some areas.
But in other areas, the fact that it uses JVM is a disadvantage.

Haskell, in my opinion, is better than Clojure. I will try to prove my reasoning:
- It has almost exactly the same productivity as Clojure.
- It has lower RAM usage. Modern Haskell uses relatively little RAM, so it is also suitable for system services programming.
- It is often thought that Haskell is 2-3 times slower than C. But in reality, in many apps it is as fast as the fastest C apps. Here is an example:
haskell-benchmark.png

(warp = Haskell and warp is as fast as NGINX written in pure C language)
- Fewer bugs than Clojure (due to the fact that Haskell is one of the purest languages in existence)
- Despite the very advanced capabilities of the language, I find Haskell, along with REBOL, to be the easiest programming language I have already learned.
In any case, there are several Haskell books that are very accessible and allow most programmers to learn it without the slightest difficulty.
- Haskell is one of the best scripting languages thanks to the runhaskell program. Clojure, on the other hand, is not suitable for scripting.
 
Yeah, I was simplifying. At least Ruby has continuations so you know what you pay the price for.
With the current performance improvements to Python, I think Python could have become almost as fast as Lua.

I have often seen people claim that FreeBSD's boot process is written in Lua.
Why? Isn't it easy to rewrite it to something fast like Haskell?

But to be clear I agree with you that Python is very slow.
>90% of programming languages are indeed faster than Python.
 
With the current performance improvements to Python, I think Python could have become almost as fast as Lua.

I have often seen people claim that FreeBSD's boot process is written in Lua.
Why? Isn't it easy to rewrite it to something fast like Haskell?

But to be clear I agree with you that Python is very slow.
>90% of programming languages are indeed faster than Python.

FreeBSD's bootloader now uses LUA, it used to be forth (which I think was cooler). But it is excessively light scripting, so performance isn't required.

My main beef with performance in the scripting languages is not the plain speed, but the inability to use more than one core worth of CPU power from threads. That is really the antithesis of scalable software that everybody is blabbering about all the time.
 
[ I know typed-racket and it was worth the effort learning ]
I came across following names : although i don't know what they are good for ,or bad for. Nor how to use them.
-carp
-qi
-coalton
-blisp
-typer
-shen
 
I played a bit with Coalton. It's promising but libraries need further development.
Currently it's difficult to mix Coalton functions with non-Coalton functions, you have to wrap and that is tedious.
Coalton has application in quantum computer simulation.
The other names above i don't know.
 
[ I know typed-racket and it was worth the effort learning ]
I came across following names : although i don't know what they are good for ,or bad for. Nor how to use them.
-carp
-qi
-coalton
-blisp
-typer
-shen
It's more easy to make yourself think in terms of a Turing machine if you write in Haskell.
Racket is more "impure". In Haskell it is easier.

Racket is largely implemented with Chez Scheme that I mentioned earlier.

Some Typed Racket features provide flexibility that Haskell cannot express, while keeping everything safe. For example, Typed Racket supports variable arity functions (like Racket's `+', `list', `map', etc.), dynamic type checks, optional and keyword arguments, etc.

Haskell takes the attitude that the type system is a fundamental part of the program design, and typed Racket takes the attitude that the program comes first, and the type system's job is to check that nothing is going to go wrong.

Of course, Haskell also provides type system features that Typed Racket does not, such as type classes or type-level programming.

Haskell is a mature, very old compiler. Typed Racket is an evolving, younger language.
I wonder if Typed Racket is going to be able to perform similarly as Haskell. Seems to me that Haskell can be much faster in some situations:

Racket 105.218 ± 0.312 sec
optimized Haskell 3.517 ± 0.009 sec

Haskell beats C

Benchmarks show that these Haskell programs can perform competitively with hand-written C.
 
Why reference God when FreeBSD is supposedly the Devil? 🤣 Not to mention that 666 is perfectly valid UNIX permissions?
1695395348542.png

Edit: Now I know why those languages were such a pain to program in! ;)
 
Mainly because a woke religious person, who is offended, and as such victim, might need a safe zone, in order to be protected from the devilish curses of Beasty.
 
Back
Top