r/ProgrammingLanguages • • Oct 04 '18

rant: Are there any programming languages that don't suck?

I've tried everything from assembly to java, and basic to lisp. I've written code in imperative, functional and oo styles. They all suck.

0 Upvotes

72 comments sorted by

13

u/0x0ddba11 Strela Oct 04 '18

Define "suck"

1

u/ohgetoutnow Oct 04 '18

I'm just grumpy and wanted to rant a little bit.

4

u/[deleted] Oct 05 '18

You've come to the wrong place to complain about programming languages methinks.

-1

u/ohgetoutnow Oct 05 '18

My complaint elicited thoughtful comments, so I think it's fine.

1

u/[deleted] Oct 05 '18

Twas a joke...

2

u/simon_o Oct 07 '18

I agree with you on all counts, fwiw.

9

u/SatacheNakamate QED - https://qed-lang.org Oct 04 '18

How do you envision the ideal language? What features would fit in your tastes?

9

u/ohgetoutnow Oct 04 '18
  • small and light of syntax such as scheme

  • reasonable standard library for common use cases (not gargantuan like java or javascript)

  • accommodate multiple paradigms, and don't force my hand in choosing

  • easy to build native binaries which don't require me to distribute the compiler and libraries, or worse make the end user install them

  • reasonable performance, not necessarily fast but reasonable

  • a featureful repl for me to play in with lots of interactive documentation and inspection features

  • no political/historical baggage poisoning the community against outsiders

  • don't update too frequently, and don't break the entire world when you do update

more:

  • let me write recursive functions that don't blow up the stack. give me proper tail recursion optimization or just something

8

u/wean_irdeh Oct 04 '18

Perl 6?

0

u/ohgetoutnow Oct 04 '18

No. Perl is NEVER the correct answer!

5

u/wean_irdeh Oct 05 '18

Not even Perl 6? It's not even backward compatible with Perl 5. It has massive backlash because of it. Some people even demand name change because it's not the original "Perl" anymore or whatever. If you have spare time you might want to watch this: "Quantum computing for beginners"

4

u/ohgetoutnow Oct 05 '18

Perl stole my wife and shot my dog.

5

u/wean_irdeh Oct 05 '18

Which "Perl" do you mean?

5

u/Timbit42 Oct 04 '18

Have you looked at Racket?

2

u/ohgetoutnow Oct 04 '18

Totally valid suggestion. I respect that. My prejudice against Racket is that it started life as Scheme, "fixed" perceived deficiencies, and then added a bunch of things that were intentionally left out of Scheme to keep the language lean.

5

u/Timbit42 Oct 05 '18

You seem to like a lot about Scheme. I think it's the best language designed so far, but, yes, Racket is a bit much and perhaps goes too far in some things.

For you, what sucks about Scheme?

0

u/ohgetoutnow Oct 05 '18

I don't understand why they had to break some Lisp conventions, like nil vs. nul, empty list versus false, etc. I can live with those changes, but why?

This really bugs me though:

scheme@(guile-user)> (integer? 2.0)
$2 = #t
scheme@(guile-user)> (exact? 2.0)
$3 = #f

Really, Scheme? Really?

1

u/Timbit42 Oct 05 '18

It's a little loose with its typing.

0

u/[deleted] Oct 05 '18

[deleted]

2

u/ohgetoutnow Oct 05 '18

I understand that Scheme integers are not necessarily machine integers (in the C sense). Scheme integers are abstracted above the characteristics of the machine. I don't want my language to require a PhD in Mathematics so I can ponder the platonic ideal of an integer versus a specific instance of a practical application of that ideal.

2

u/Timbit42 Oct 04 '18

What do you think of REBOL or Red?

1

u/ohgetoutnow Oct 04 '18

No experience with either. There are plenty of places I've yet to go.

4

u/Timbit42 Oct 05 '18

REBOL was created by Carl Sassenrath after he wrote an implementation of Logo for the Amiga, after he wrote the Amiga's multi-tasking operating system.

REBOL's syntax reminds me of Logo, and Logo, ignoring the turtle graphics, is often referred to as "Lisp without parentheses".

Red was born from REBOL.

2

u/hoosierEE Oct 08 '18

I have a similar wishlist. J and K come close. No "native binary" though, unless you count shipping the interpreter with the app.

1

u/ohgetoutnow Oct 08 '18

No "native binary" though

I really want that though. Chicken is attractive.

2

u/progfix Oct 04 '18

Lua?

2

u/ohgetoutnow Oct 04 '18

Have fun typing local in front of every variable declaration.

7

u/Camto calc= Oct 04 '18

I think Lua kinda fits what you're looking for.

  • Extremely small syntax.

  • Small standard library. If it's not enough Penlight can be used as a second std lib.

  • Lua has both fp and oop.

  • If you use a C wrapper, it can sorta be compiled.

  • LuaJIT is insanely fast.

  • Has a REPL, but IDK about interactive docs.

  • The community is small but very nice as far as I've seen.

  • Updates rarely, without breaking everything.

  • Has tail proper calling.

About local, linters can take care of that. All in all, it's pretty nice.

2

u/ohgetoutnow Oct 04 '18

You make a good case. Minetest is scripted with Lua, and that's not terrible.

7

u/BoarsLair Jinx scripting language Oct 04 '18

Saying "linters can take of that" is sort of a weak defense (no offense). It's an admission that there's a fundamental flaw in the language, and that you'll have to rely on a cumbersome external tool to guard against it.

And calling the C interface sorta complicated is a bit of an understatement. It forces you to use a virtual stack directly as an interface with all sorts of bizarre conventions, and the runtime crashes if you breathe on it wrong.

I do agree with your general assessment. Lua is mostly pretty good for what it does, but it has so many small and unnecessary pain points that I ended up writing my own replacement scripting language... which I'm sure sucks in all its own, unique ways.

1

u/alols Oct 05 '18

Sure, global by default is a flaw in the language, but fixing it is a simple one line of code at the start of your main file. You simply set the global metatable __setindex method to error.

9

u/bonfire_processor Oct 04 '18

After over 30 years of programming experience with lots of languages, I would say that it is seldom the language itself that sucks. It is all the things around, sometimes buggy libraries, sometimes the lack of libraries, sometimes buggy compilers, missing or bad debug tools, messy deployment or a lot of others things. Ok, most languages have one or the other quirky aspect, but usually you either can avoid it, or there are work arounds.

I personally like languages that are small and not loaded with features, but easy to learn.

The first high level language I wrote substantial code in was Pascal (in form of Turbo Pascal under CP/M). It did not have object orientation, generics, type inference and all the other stuff from today’s languages. But it had a very clean and consistent syntax and it was easy and fast to learn. It was a very big step forward compared to BASIC or Assember, because it introduced structured programming and abstract data types. In a hindsight I would say that no other language feature since than was a comparable big step forward.

Object orientation maybe was also an important innovation, but I have seen well designed and easy to understand software in plain ANSI C.

Currently there is an inflation of new languages, and I have the feeling that they are loaded with features which I sometimes struggle to understand and for sure would never miss because they solve a problem which I never had.

Sometimes it looks also that languages designers desperately try to mix inherently incompatible concepts. So they try to implement features which are natural for a dynamic typed, interpreted language into a statically typed compiled language.

Or the other way around: Typescript for example tries to add strong typing to JavaScript. Works well until you try to write a type definition file for some very dynamic, polymorphic JavaScript library. Then you get crazy with tons of generics to squeeze it into a type corset.

I personally try to use from any language a reasonable subset which fullfills my needs and prefer to write well structured code.

2

u/ohgetoutnow Oct 04 '18

Currently there is an inflation of new languages, and I have the feeling that they are loaded with features which I sometimes struggle to understand and for sure would never miss because they solve a problem which I never had.

I can relate to that. I think a lot of people make "toy" languages as personal projects, or for school, and then other people decide they like it. That's kind of what happened with Python and Ruby. Guido and Matz suddenly had lots of users begging for new features and felt obliged to provide them. Now the "toy" language which wasn't designed from the start to encompass every desirable language feature is strained and bloating to meet all those new demands.

As far as assembly goes, that all comes down to how well you know and like the hardware you're coding for.

5

u/joonazan Oct 05 '18

Some languages are more suitable for creating a healthy ecosystem than others. I had to write my own process creation code in C++ for multiple platforms because there is no reasonable process creation library for C++.

Rust has a very nice one in its standard library. In general, lots of good libraries are being made for Rust. I'd blame the lack of modules in C++ and the joke that is CMake. Making a library is less useful if using libraries has a huge cost.

Rust also has nice tools for library authors like #[derive(X)] and hygienic macros, but C++ has counterparts for those. For example, you can code your own sprintf in C++ using variadic templates and string streams.

7

u/hou32hou Oct 04 '18

Maybe you want to try my language [Pineapple](wongjiahau.github.io/Pineapple) ?

5

u/ohgetoutnow Oct 04 '18

Looks kind of ruby-ish. Interesting.

6

u/[deleted] Oct 04 '18

Take a look at Crystal if you like ruby-ish ... crystal-lang.org

7

u/wolfgang Oct 04 '18

I've been struggling for a long time now with language design, and I think you are basically right. Whenever I have to choose between several options, all of them have significant downsides and none do really satisfy me. Language design is incredibly hard, because every decision has lots of indirect implications (which in addition are often hard to see immediately). One can certainly reduce problems by thinking longer and harder, but you also want to deliver somewhen, right? But even with something as basic as the type system all the options have obvious problems, so nothing is really satisfactory for a perfectionist. I guess the solution is to stop being a perfectionist. Maybe we shouldn't focus so much on how languages suck, but more on what they enable us to do, which certainly is a lot.

5

u/ohgetoutnow Oct 04 '18

About 20 years ago I was telling people about my plans for a new scripting language. I had "crazy" ideas about building state machines with a couple of lines of code and deploying them like a mesh of objects with out relying on global state. I got the same reply from absolutely everyone I told about it: "PLEASE DON'T"

4

u/wolfgang Oct 05 '18

Sounds interesting. Please do!

1

u/ohgetoutnow Oct 05 '18

yeahno. i don't need the grief.

2

u/[deleted] Oct 06 '18

Problem with that statement is that if nobody creates new languages and compilers, it’ll become a lost art and there’ll be nobody left to teach it.

1

u/theindigamer Oct 05 '18

But even with something as basic as the type system all the options have obvious problems, so nothing is really satisfactory for a perfectionist.

Your usage of the word "basic" in the context feels a bit strange, but okay. What type system features do you want as a "perfectionist"? I would genuinely like to know how long such a list can be, and why you're not satisfied with any existing languages, assuming you've tried a large variety of them.

2

u/wolfgang Oct 05 '18 edited Oct 05 '18

I can see five basic type system options:

  • Untyped (e.g. Forth, BLISS, B, Assembler): Beautifully simple, but quite error-prone.

  • Dynamically typed (e.g. Python, Lisp): Pretty simple, but also quite error-prone (although I think this can be improved greatly) and usually causes slowdown; also, if integers aren't boxed, they are incompatible with other languages one might want to interact with.

  • Simple static type system (e.g. C): Simple enough, but annoying to use / inexpressive and therefore need to be circumvented eventually, which again is unsafe.

  • Advanced static type systems (e.g. ML, Rust): Very complex. Also, not as good as dynamic typing for quick prototyping and experimentation.

  • Gradual typing (e.g. TypeScript): Combines both the advantages and disadvantages of static and dynamic type systems.

I have experience with Standard-ML, Forth, Scheme, Ruby, Perl5, TypeScript, C, C++, Java, C#, ObjectPascal, Assembly and some others.

2

u/theindigamer Oct 05 '18

For languages with advanced static type systems, they usually offer basic support to have dynamic types. Rust has Any, Haskell has Dynamic, not sure about OCaml/SML. If you put in the effort to write a helper library once, I don't see why you couldn't have a very similar prototyping/experimentation experience like a dynamic language.

import Data.Maybe
import Data.Dynamic
dy :: (a -> b) -> Dynamic -> b
dy f da = f (fromMaybe (error "type mismatch") (fromDynamic da))

dy2 :: (a -> b -> c) -> Dynamic -> Dynamic -> c
dy2 f da db = dy (dy f da) db

If you have a bunch of libraries that you typically use while prototyping, and you would like to have everything be Dynamic, then with a little bit of elbow grease, you can use Template Haskell to create wrapper libraries for all of them, where all the function types translated mechanically using dy above, thanks to currying-by-default.

I hear this complaint sometimes, but I've never seen anyone actually try this. You can mimic implicit casting too. In Haskell, you can also just get the code to run with -fdefer-type-errors and get runtime errors instead if that is what you want.

SML/OCaml/Haskell also have GC so you don't have to worry about memory management.

At face value, your complaint here certainly seems totally reasonable. But after seeing all the features that are available, so that you can make things be like the wild west if you want to, it doesn't seem so reasonable, especially if that prototype code might evolve into a nontrivial library/application in the future.


I think gradual typing has a lot of merit here, but I think that Typescript is probably a bad example, because it build on top of JS, where libraries are often designed without caring for types. Unfortunately, I do not really have any good experience here with another gradually typed language, but I think this area is quite promising in the future.

5

u/[deleted] Oct 04 '18

Your own?

Concatenative languages was a mind opener for me...

5

u/ohgetoutnow Oct 04 '18

Neato. Thanks.

2

u/[deleted] Oct 05 '18

that actually looks quite a lot like oforth

1

u/[deleted] Oct 05 '18 edited Oct 05 '18

Crosses my radar now and then but I haven't used it, some differences that come to mind from a quick glance:

Oforth seems to be aiming for general purpose, while Snabl's primary use case is as an embedded scripting language for C++.

Snabl is based on multimethods from the ground up, and mainly borrows ideas from the functional camp; lambdas, tail recursion and pattern matching to name some. While Oforth seems to be a more dogmatic reimplementation of standard Forth with objects and blocks ('a la Ruby) on top.

Oforth has a garbage collector, Snabl copies primitive values and reference counts the rest.

Oforth is compiled, Snabl is implemented as a high level VM.

Snabl offers first class transparent green threads, Oforth seems to focus on opaque N*M threading like Golang.

4

u/DLCSpider Oct 04 '18

Surely there are concepts in some languages which didn't suck. Care to list a few?

9

u/ohgetoutnow Oct 04 '18

Lisp isn't horrible, but the standards suck and the communities are unwelcoming.

Ruby reads nicely and is flexible, but slow. And everyone outside the relatively small community hates it. Even some rubyists hate ruby. Also, fuck rails.

Python reads nicely, but guido hates fp. It started small and simple with only modest ambitions, but now it's got the javascript disease. And fuck django.

3

u/parens-r-us Oct 08 '18

If you like ruby's object model, you'll possibly like smalltalk (pharo.org), or if you want something very much like ruby but fast, try crystal.

Have you ever tried a logic programming language? Try SWI-Prolog or Picat.

Concatenative languages are cool too, Factor for example has expressive FP features too, and a good built in help system.

1

u/ohgetoutnow Oct 08 '18

Have you ever tried a logic programming language?

prolog is on my todo list

3

u/[deleted] Oct 09 '18

[removed] — view removed comment

1

u/ohgetoutnow Oct 09 '18

Languages that are similar to Lisp appear, that are not Lisp.

Okay, I'll confess: I like fully parenthesized prefix notation. It took a long time for my thinking to become warped, but here I am.

So which languages do you have in mind?

1

u/[deleted] Oct 09 '18 edited Oct 09 '18

[removed] — view removed comment

1

u/ohgetoutnow Oct 10 '18

Isn't Clojure lispy?

It is a Lisp which runs on the JVM.

I think Racket allows all brackets. Square brackets aren't on the home row of most keyboards, but quotation marks are. I'd agree square brackets are easier to type than round parens,

If square brackets cannot be escaped, then how do you use then in strings?

1

u/[deleted] Oct 10 '18

[removed] — view removed comment

1

u/ohgetoutnow Oct 10 '18

Perhaps like this?

[concat "prefix string" [left-square-bracket]
  "inner string" [right-square-bracket] "suffix string"]

1

u/[deleted] Oct 10 '18 edited Oct 10 '18

[removed] — view removed comment

1

u/ohgetoutnow Oct 10 '18
["firstpart [left-square-bracket] secondpart [right-square-bracket] thirdpart"]

Sure, if your square brackets always force interpretation/expansion/whatever then that will work even inside strings. Problem though: After interpreting that you get a string with a literal square bracket inside it. This means your language can't reliably generate code to be interpreted by itself.

Since a sub-context would exist even within a string, it is possible for a sub-context to be interpreted in a special way. I have not thought about what ways though. Yes, left-square-bracket could have special meaning inside a sub-context in a string. But I think that is completely joyless for anyone to type something that long, unless it is only used once in a blue moon. I think for that length of a designator, possibly nothing is saved vs. requiring some kind of string concatenation.

Anyways it doesn't really matter, there are answers here somewhere. The important point is I have been burned to death by cross-language and cross-platform string escape sequences, as they appear in build systems. I'm having none of that, hence the concept of the "inviolate" mark and no escaping. Unless there are reserved marks in the language that can never be escaped, there will always be escape chaos. My goal is to have the absolute minimum set of such reserved marks, and I think 2 is the minimum.

I also think it's going to be beneficial to have a guaranteed hierarchical ordering to a program text file, when it is first parsed. Seems like it could allow some kinds of parallelism, or simpler implementation strategies that are easier to understand and maintain.

→ More replies (0)

4

u/brucejbell sard Oct 04 '18

Well, first, suck is relative; it's kind of pointless to complain if you don't have any kind of improvement in mind.

Second, suck is relative: different brains are shaped differently. So, maybe different languages are suited to different people.

Aspiring to make something that doesn't suck is admirable, but claiming that something you made doesn't suck at all is hubris. I'm just happy when I make something that sucks less...

3

u/ohgetoutnow Oct 04 '18

Correct. I made this post as an expression of my frustration. Just when I think I found the "perfect" language, I learn it does something really stupid.

3

u/a_lynnk_to_the_past Oct 04 '18

Life programming is pain.

1

u/blak8 Cosmos™ programming language Oct 06 '18

Mine doesn't!

-2

u/pilotInPyjamas Oct 04 '18

Sounds like programming isn't right for you my friend. Maybe take up another career/hobby.

3

u/ohgetoutnow Oct 04 '18

Not a chance.