Why do we need Heck?

Over the course of many decades, we've developed a variety of programming languages in order to solve a variety of problems, and in doing so, we've learned a lot about what makes languages great.

Sadly, some of the most popular languages were developed before modern programming practices were introduced, or they were initially designed for a purpose that's completely different from their use today.

JavaScript is one of the worst cases of this. It was initially designed to add simple functionality to HTML pages, but the scale and importance of the web has significantly evolved past that. JavaScript still has many fans, and it was my first programming language (so I think I can criticize it), but it's clear that it has many issues, especially considering its importance to the web.

JavaScript's type system is both confusing and inconsistent, as shown by the famous wat video, it has prototype-based objects which are supposed to be simple, but instead most programmers end up trying to emulate classes with them (possibly an opinion), and possibly worst of all, the original method of declaring variables has no respect for scope.

Luckily,  some of these issues have been addressed, such as the let keyword that allows you declare variables with respect to the proper scope, but many of JavaScript's flaws can never be fixed in a backwards-compatible manner.

C++ is another language that has evolved past many of its original goals, but at least it has a reasonable type system. The problem is that it's the most powerful language, so whenever programmers need to solve a new type of problem, a new feature is added.

Many of the additions to C++ are brilliant and just misused frequently, but I think both of these languages (especially JavaScript) show that we need to design a new language with newer use cases, programming practices, and features in mind.

Don't get me wrong, I think both C++ and JavaScript can be great languages at times, and C++ is actually one of my favorite languages, but I also think many programmers would agree that we need to just take a step back, try to find out what we need from our languages, and rebuild from scratch.

If this wasn't the case, we wouldn't be continually developing new languages like Rust and Go in order to solve our problems.

So what's the problem then? If we're already making a ton of new languages, why do we need another one?

Well, like most new languages, the Heck programming language is attempting to take some of the good ideas from older programming languages and fit them with modern programming ideas, and also to address some things that other languages seem to ignore.

Back when C was considered high-level, people needed to write fast and lightweight code. C was established as the best tool for the job, and as a result, many great programming constructs and practices were developed.

Many people consider C to be an old and chaotic language, but anyone who has really gotten to learn C can probably see the beauty in the way the programming constructs are built.

The Rust community does have a point, though. There are many problems that come with manual memory management, and some modern languages show that it can be avoided, or that the compiler can hold your hand most of the way. C++ and Rust have shown that we can make compilers smart enough to do a lot more work at compile time, but languages don't seem to take this far enough.

There is so much power in the realm of static typing and compile time, and Rust has been the number one language to tap into this power, but no languages seem to do a good job at making sure you never notice.

That's what the main philosophy for Heck is. We're smart enough to make compilers that do so much of the work you'll think you're programming in a scripting language, but you'll somehow always know what data types you are dealing with.

We need our languages to be easy to use when necessary, but they should also be able to step back and let you go as low level as you want.

Heck is a language that allows you to do this. It will always be able to deduce types for you, and most of the time it will feel like a high-level language, but when you need to, you'll be able to have more control.

This is an important aspect of programming that I don't think gets enough attention. Parts of your code will often require very high performance, but once you create something powerful and complex, you'll want it to be easy to use. This is why Python is so popular. It lets you write complicated tasks in C where performance matters, and then you can use Python as a convenient interface.

Python itself is a language that can be improved upon though, and if you're willing to make something better, why not take it a step further and make a language that can do both? Making a language that allows you to write like C or C++ (albeit in a more organized fashion) while still retaining the ability to write the rest of your code like Python would solve endless problems. Many cross-platform issues would no longer exist, programs wouldn't have to take all the extra steps to communicate with their libraries, and users would have a lot more power.

Of course, some C code is a necessity at this point, and while Heck will allow you to make new, powerful libraries, it will also be able to communicate with C code, where countless man-hours have already been spent.

All of this sounds great, but it means nothing if there is no implementation. While I am working on Heck, which I am currently implementing in C (visit https://github.com/mashpoe/heck), I will be writing a series of articles on this blog in order to demonstrate what my claims for Heck will entail.

In the meantime, you can either patiently wait, design your own language, or contact me. I am open to suggestions as I want this language to be the best it possibly can, and I believe in open source!

(my implementation of Heck is under a BSD license)

Comments

Popular Posts