Hacker News new | ask | show | jobs
by buzzybee 3290 days ago
I've been musing about these sorts of issues of "what is really complex" lately, too. I started evaluating new languages for low-level application code again after spending a lot of time overly close to web browsers, and then ended up deciding that Free Pascal beat them on the stuff I cared about, relative to C compilers as a baseline:

* Best-in-class compile times

* Modules; preprocessor is relevant, but not dominant

* Generics, variant records, function and operator overloads, exceptions, safe string and dynamic array types

* Libraries for common things, with a reasonably conventional style: APIs, containers, bindings, etc.

* No GC; pointers are available, but language features discourage casual usage. RAII pattern is achievable.

* Strong + static types, nominal types and type aliasing.

* Good IDE support, mature tooling, compiler has very broad platform support.

The new languages do win on a lot of the language-feature aspects(particularly memory safety when performing deep optimizations), but they don't have as good a story on the tooling. The compile speed is a major feature and is only likely to remain advantageous over time - and the features already in place are quite effective at limiting source code size, boilerplate, and dangerous constructs. This despite "Pascal is verbose" being memetic.

And if I want more high-level power, I've found that writing a FSM is the most probable path to achieving it. A FSM that embraces the problem domain is a tiny compiler: input source constructs, FSM checks them, applies appropriate algorithms, then emits a list of actions. More power? Add a second FSM to make it a two-pass compiler. Add a stack, or attach it to a database. If it has to be fast, it can generate code in the last step, too. Those things add tons of power to model the problem and aren't heavily dependent on language-side support.

1 comments

Yup, we already had all of that in Turbo Pascal for MS-DOS, hence why I never saw any value in C back in 1993.

On those days outside UNIX, C was just yet another systems language, with most home micros being written mostly in Assembly.

Also Turbo Pascal OOP features were adopted from Apple's Object Pascal, used to write the initial versions of Lisa, Mac OS and known software like Photoshop.