DEV Community

Cover image for 5 Compiled Languages for Script Kiddies
K
K

Posted on

5 Compiled Languages for Script Kiddies

If you know me (which you probably don't since nobody of the people who know me are reading this [just my beloved ones <3]) you're aware that I'm a script kiddie by heart. ;)

But even I, someone who never really tried native development after leaving high-school, could ignore that much is happening in the native world lately.

For many people, native development or system development, means C or at least C++. It's how our ancestors did it! It's the way of high performance. It's the only way.

But this isn't true for a long time anymore, and it never really was, you just have to think about COBOL.

But somehow it is burned into peoples heads, that you need C/C++ to write software that gets compiled to binaries.

In this article I will try to talk a bit about the current alternatives out there and why they could be interesting for different kind of devs and the problems they're facing.

Crystal

The Crystal programming language shares much syntax with Ruby, which makes it more suitable for Ruby devs who want to dive into the native world of development.

It also has static typing and null checks to improve reliability. Also, type inference so you don't have to sacrifice too much of the Ruby feeling when coding.

Nim

The Nim programming language is leaning more into the Python direction, syntactical significant white space all the way! It also uses a rather fast garbage collector. This garbage collector is also optional, to make Nim programs integrate more easily with C programs.

It compiles down to C, which then has to be compiled to a binary so it can use many of the optimizations C programs already get.

Reason/OCaml

The Reason programming language tries to be make OCaml more accessible for JavaScript developers.

While the main focus lies on the compilation to JavaScript, it also can compile down to native binaries, like OCaml can.

It's more of a new syntax for OCaml than a complete new language, but that enables it to use the many features OCaml provides, like a garbage collector or a static type system that got refined over many decades.

Go

The Go programming languages goal is to be pragmatic and allow for easy parallel running code. It has a garbage collector and static typing.

It seemed to me that it had C devs as target audience, but somehow mostly back-end devs from Node.js, Ruby and Python are using Go to build application servers, so I guess it's good for people coming from scripting languages.

Rust

The Rust programming language is a C like language that tries to solve the problem of automatic memory management in a static way instead of using a garbage collector at runtime. This allows Rust programs to be integrated with C code more easily.

From a difficulty stand-point I'd say Rust is as hard as C for devs coming from a scripting language, but the learning resources are much better, so it's worth a try.

Conclusion

These are just a few languages that cater to us more dynamic devs, but some even come with fresh ideas and open a world that we didn't knew we could access.

I think some are even an option for C developers that just want to get a bit more syntactical sugar in their code or weed out some bugs they wouldn't have with these new languages.

Top comments (3)

Collapse
 
chainq profile image
Károly Balogh

By the looks of it, half of these are really immature, esoteric and small languages (Roughly Go and Rust are the only exceptions). While I adore these, and love diversity, I'd never use one of these in production. Tried a few years back with some others and it didn't work out brilliantly... Long story.

But, I'm unsure why people don't consider Pascal any more as a viable alternative for product development.

It has 50 years of proven history (longer than C itself, actually), current variants have modern features (clearly, most of what sane people use from C++ for sure, and more), it's strongly typed, it's usually considered very readable and beginner friendly - as it was originally designed as a teaching language, and it has an extremely mature (20+ years old), but continuously maintained self hosted free and open source (GPL) implementation, supporting dozens of platforms and most major and important CPU architectures (Free Pascal). It can also do and support embedded directly. And it compiles to 100% native code. Or it can also target a JVM if you want to port the same code over to Android for example. It doesn't sport a garbage collector out of the box, but it has some reference counted container types, and it has a plugable memory management system, with 3rd party garbage collectors, if one insists on having that.

It also guarantees your code investment. I've seen someone compiling some scientific Pascal code from the '70s with FPC to a native 64bit Linux binary, and hooking it into a Travis CI setup. It's not going to break its syntax with the next major version for sure.

Although admitted, Pascal is not trendy and not considered cool for sure in many circles. Depends on what one's priorities are. ;)

Collapse
 
eljayadobe profile image
Eljay-Adobe

Good point on Pascal!

Pascal is still alive and well, and still under active development and support.

Plus the extended version from back in the 1980s, by Niklaus Wirth and Apple. Called Object Pascal.

Although these days Pascal is around under branding names:

There are probably others, those are the one's I've used.

Collapse
 
bgalvao profile image
Bernardo

I think Go is having newcomers from Node, Python and Ruby because Go is meant for better scaling and concurrency. Also, it was built from the ground up with multi-core processors in mind. I kind of like the way it scripts, except working with arrays feels a lot like... Java - you have to use a for loop pretty much. While this is just minor, I would love to see those map(), filter(), reduce() functions that we can find in JS and Rust.

Rust feels more suited for multi-file programs. AFAIK you can't really use external packages/libraries without setting up a cargo project, including the dependency in the cargo.toml file and compiling it all together. Even if all you wanted from the start was a single file script.

I love Rust, but I'd still use Python for scripting and Node to deal with server side (ok maybe Go).