Conversation
Edited 1 month ago

I feel like my ideal programming language would be:

  • the simplest core language possible*, with thorough documentation of the exact behaviors of every aspect of the core language
  • on top of the core language, add enough syntactic sugar to be as convenient to use as Python
  • document all of the syntactic sugar by showing what the core language equivalent is
  • then add a full-featured standard library like Python’s

* simple to understand, but not necessarily simple to implement or mathematically simple. for example it is very easy to understand what 1 + 1 means when you see it in code, even though add(1, 1) could be considered “simpler” in terms of implementation

that way it would be a very expressive and nice-to-use language, but it would also have almost no magic whatsoever. you could learn the core language and then understand literally everything else in terms of the core language equivalent. so you wouldn’t have to memorize quirks of the module system or package.json semantics or edge cases of defining a class or anything else like that. becase as long as you know the core language and you know what your syntactic sugar is turning into, you would understand everything perfectly

also it should absolutely have Lua’s require() and dofile() functions because those are by far the most elegant module system I have ever seen

2
0
2

“kas you’re basically describing Lisp”

I do think that Lisp is trying to do what I want, but the problem with Lisp is that

  • its syntax is way too restrictive. that does make the core language extremely simple but at the cost of making Lisp code terrible to read (IMO)
  • my first impression of the module system is that it’s kludgy and awkward to work with and has a lot of unnecessarily complex behavior
  • also the documentation is… 😬
0
0
1

@kasdeya This sounds very similar to the philosophy behind Scheme, at least in terms of core language and composition on top of it, plus ability to add sugar. Although I don't think it hits all of them.

1
0
1

@Shivaekul ooh interesting! to be honest I don’t know much at all about the differences between the different kinds of Lisps. is Scheme {more designed around the idea of having a simple core language and building on top of that} than something like Common Lisp? I’m kinda curious how their philosophies are different if you don’t mind explaining

1
0
1

@kasdeya Lisps are all pretty much built up out of basic building blocks of eval and lambda, so they start really small and are built up, which is one reason people like them.

Common Lisp was (as far as I understand it, given that it is older than I XD) an attempt to standardize various lisps and kinda take the best parts of all of them. So it's very complete and has a lot of options, and its pretty well thought out imo, but you have a ton of functions.

Scheme kinda went in the the other direction of trying to strip things down to essentials. I'm not super familar with it, but I know it is frequently used for learning about language design because it makes an effort to have a minimalistic base, which then gets sugar added to it. So that part sounds similar to what you were mentioning.

I have been meaning to read "Lisp in Small Pieces" to get a little more into how it all works, but have been focusing on other things lately instead.

0
1
1