digitcrusher / Babel-of-Code

One code, many languages…

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Babel of Code

My thoughts

Lua-likes. I only took a look at original languages that cleanly compile to Lua without dragging their own runtime or standard library along, and there are only two mainstream options fitting the description. Fennel is simply Lua with a Lisp syntax and not much of an ergonomic improvement over Lua… Unlike YueScript - a fork of the dormant MoonScript - which actually has features (eg. array comprehension) that make Lua easier to write in, although the syntax may be a bit too sugary in some places. Of course, those are not the only possibilties available to you since there do exist Lua transpilers for a plethora of other established programming languages, including but not limited to: C#, Idris, JavaScript, Oberon, Python, Ruby, Rust, Standard ML. For a full list go check out this awesome repository.

JVM-based. Java is Java, Kotlin is a better Java, and Scala is an even better Java that combines FP, OOP and beautiful programming language design, which make the coding experience really sweet… If you're willing to put up with the seconds-long builds. Don't worry, Scala. You're still my favorite. Scala also tries to provide its own standard library in place of Java's, which makes it feel like a completely different language, but sadly there still are times where you can't escape the occasional Java goo. If you're getting overwhelmed by all those big words, then you should try Kotlin instead, which is a distillation of Scala. Clojure is a Lisp for the JVM. Groovy is the real "Java-Script" and not much more sadly. Its documentation is also rather poor. There's also Gosu but there's even less concrete information about it than Groovy available on the Interwebs, it's not in SDKMAN!, its latest binary release (from 2019) did not run on my computer and the sources failed to compile as well.

Minimalistic. That is minimalistic as C is minimalistic. Zig with its zero zero-cost abstraction policy appears to be a true replacement for venerable C and, if I ever had to write something in C, I would write it in Zig. Go is akin to hammering nails with a rubber hammer. Dropping most of the everyday syntax sugar and abandoning generics at the start in favor of dynamic typing are probably the main shortcomings. It's quite a controversial language and I, personally, don't like it, so I'll let the code speak for itself. Odin is Go without automatic memory management, which makes it even worse than Go, but on the other hand it has builtin matrix math and implicit parameters.

Lisps. Lisp and its parentheses upon parentheses maybe be a bit intimidating to the seasoned programmer but fear not. This unified representation of code and data allows for one of the most powerful macro facilities in the world, which are so powerful in fact that they allow Scheme to be built in Scheme just from a mere lambda, if and set!. Scheme makes the mainstream "minimalistic" languages look complicated or lacking in comparison. But Scheme is not the only Lisp. Racket is Scheme with batteries included, which is nice but not really usable as an embeddable scripting language anymore. Some like Lisp's syntax so much that they port it to other platforms (see Clojure for Java or Fennel for Lua). I glossed over Common Lisp since it looks to be the C++ of Lisps, ie. legacy and bloated.

Lisps: Dylan functional: OCaml, Standard ML, Alice ML, Roc, Idris, Clean, ATS, Curry logic: Prolog, Mercury, Gödel array: APL, J, BQN, Octave, R scripting: Raku, Rexx, Tcl Oz, Erlang, Dart, Elixir, Opa, Gleam Fortran, Pascal, Ada, Eiffel, Sather Smalltalks: Smalltalk, Self, Squeak JavaScripts: PureScript, Elm, CoffeeScript, Gren C# platform: C#, F#, Visual Basic .NET concurrent: Chapel, Occam systems: Carbon, Crystal, D, Haxe, Julia, Lobster, Nim, Rust, Onyx minimalistic: Vale embeddable: Wren, Gravity, AngelScript, Squirrel, Io SNOBOL, Snowball, Icon, Unicon Rebol, Red, Boron ParaSail proof assistants: F*, Lean bizarre: Factor, Forth, UCBLogo

Zgadywanko

  • lazy collection operations
  • error handling and throwing
  • pipelined string operations
  • command-line arguments
  • interactive terminal I/O
  • arbitrary-precision integers
  • random number generation
  • pattern matching/switch expressions
  • ternary operator/if expressions

About

One code, many languages…


Languages

Language:Odin 11.9%Language:Zig 9.7%Language:Go 9.2%Language:Java 8.4%Language:Haskell 8.0%Language:Scheme 6.8%Language:Racket 6.6%Language:Kotlin 6.1%Language:Scala 6.0%Language:Clojure 6.0%Language:Lua 5.7%Language:Fennel 5.6%Language:Groovy 5.6%Language:Ruby 4.2%