Alternative programming languages and their usability on *nix - Programming On Unix

Users browsing this thread: 1 Guest(s)
opfez
Members
Hello!
I've been trying out a bunch of languages the past months, and wanted to start some discussion on the usage of other languages than traditional ones (C/++, Perl, Python, etc.).
One of the most interesting ones is Common Lisp. I've written a phlog post on programming in it on the gopher://g.nixers.net, but the main take away is that it is incredibly fun to work with. It's cool because it's not as simple as recompiling your project when you make changes, you can individually compile parts of your program, like a function, and try it out in the REPL afterwards. The downside is that it is very much dpendent on the REPL and it's hard to get a nice binary to send to others. I also find it not very *nix friendly as it isn't good to work with stdin and stdout like most (good) Unix tools.
Another one is Zig. My best description of it is "a modern C". It is basically a huge fork of C, but it's very different. The preprocessor, for example, is gone. One of the most interesting things with Zig is the ability to execute code in compile time. Asserts, if/else checks, anything can be executed at compile time, making it great for debugging. It's completely compatible with the C ABI, so you can use any of your favorite C libraries with it. Therefore, it has great *nix compatibility. Hooray!
Other languages I'm a bit interested in is Julia, with it's multiple dispatch-oriented design and Scheme, being a more simplistic Lisp with the ability to time travel in your programs (?!).

What languages are you most excited about, and how are they to work with in *nix?

Edit: Got an idea for a follow up question: What language do you think future *nix tools will be written in? Will they be written in C, or something more modern like Go?
jkl
Long time nixers
The thread title is weird. "Alternative" programming languages, compared to what? You even suggested the relatively young (and not very interesting) Python to be a "traditional" language - compared to what? It is hard to name languages if their superset is undefined.

Common Lisp is a very good language indeed, but it lacks a standard package manager. Quicklisp might be the most commonly used one, but when I released my RSS generator and shared it with Hacker News, some of the commenters told me that they actually don't use that. So, in order to distribute my Common Lisp applications in a non-binary form, I would need to invest more work than I'd like to - or make life for my potential users harder than I should. That's why I stopped sharing my Common Lisp code. My former excitement for Pascal has faded for similar reasons: The small standard library would require a metric ton of dependencies to be shipped. Even Delphi faces a similar problem.

As you keep mentioning Zig, my point of view on "modern C"-lookalikes is that Go has won this war and there is no reason for a third language between Go (client/server applications) and C (local applications) to exist. Go has an excellent toolset and is rather portable (even on Plan 9). The relevant advantage of C over Go is that the Go enforces a very verbose code style, including only one allowed way to place braces. I like writing in Go though.

The only other language which I refuse to give up is Perl which works great for web applications and has a giant community because of its age. All other languages depend on their use case; I even try COBOL every now and then. - But sometimes the languages choose me: I recently found a problem when trying to use Go to replace an aging Python tool of mine. Now the only other good API client for what I intend to achieve is a Rust one... hmm.

Unrelated side note: I wish I could understand APL better. APL looks efficient.

--
<mort> choosing a terrible license just to be spiteful towards others is possibly the most tux0r thing I've ever seen
opfez
Members
(23-10-2020, 06:06 AM)jkl Wrote: The thread title is weird. "Alternative" programming languages, compared to what? You even suggested the relatively young (and not very interesting) Python to be a "traditional" language - compared to what? It is hard to name languages if their superset is undefined.

Yeah, should've made myself more clear. By alternative I basically mean "not widely used".

(23-10-2020, 06:06 AM)jkl Wrote: there is no reason for a third language between Go (client/server applications) and C (local applications) to exist.

I kind of agree on this one, but in a different way. In a sense, Zig is a language to supercede C. Every program that is written in C can be rewritten in Zig because it's basically the same language, but with better syntax and a few more features while not being bloated and unnecessary like C++ or Rust.

(23-10-2020, 06:06 AM)jkl Wrote: Unrelated side note: I wish I could understand APL better. APL looks efficient.

APL looks awesome.
jkl
Long time nixers
(23-10-2020, 06:18 AM)opFez Wrote: By alternative I basically mean "not widely used“.

How do you know how many people use a language for how many projects?

(23-10-2020, 06:18 AM)opFez Wrote: In a sense, Zig is a language to supercede C. Every program that is written in C can be rewritten in Zig because it's basically the same language, but with better syntax and a few more features while not being bloated and unnecessary like C++ or Rust.

So, in a sense, Go is a language to supercede Zig?

--
<mort> choosing a terrible license just to be spiteful towards others is possibly the most tux0r thing I've ever seen
opfez
Members
(23-10-2020, 06:24 AM)jkl Wrote:
(23-10-2020, 06:18 AM)opFez Wrote: I kind of agree on this one, but in a different way. In a sense, Zig is a language to supercede C. Every program that is written in C can be rewritten in Zig because it's basically the same language, but with better syntax and a few more features while not being bloated and unnecessary like C++ or Rust.
So, in a sense, Go is a language to supercede Zig?

I think Go has it's place as a high level language for doing general purpose stuff, like Java, but Zig is a nice language for doing general purpose and low level stuff like C.