What would the perfect programming language look like?

ramases

Ars Tribunus Angusticlavius
8,104
Subscriptor++
That the kind of thing that run away to north pole, killing many in its journey.

Many years ago my professor in the "Intro to Compilers" course was one of the authors of the GNU Forth compiler. A couple of his grad students were absolute bonkers in Unreal Tournament. I have some painful memories of getting completely pasted in Assault, and by their statements he was even more of a madman in it.

Did you, by chance, refer to this type of thing? :eng101:🤣
 

benwiggy

Ars Scholae Palatinae
1,046
So when the IF on line 1860 evaluates to true, everything from THEN to end of line is executed. So you need that GOTO to skip over line 1870 that handles the ELSE situation.
I grew up with BBC BASIC, which had IF, THEN and ELSE; as well as named functions and 'procedures'. It entirely avoided the use of GOSUB and GOTO <line number>. It also had REPEAT .. UNTIL. Later version had WHILE.
 
  • Like
Reactions: Hagen Stein
One of the things I like about Lisp and SmallTalk especially, though, also, things like Ruby and Python, if to a lesser degree, is how the relatively simple and flexible syntax means that you can tackle this kind of problem fairly directly. If your program is best described in imperative syntax, it's fairly simple to write something with a threading macro that looks just like imperative code. Similarly for any other bit of syntax that would make your program easier for Joe Average to understand, the nature of the language lets you create that syntax. As such, the vast majority of a program written in LISP is typically much easier to understand than one written in an imperative language.

Of course, this does create a problem when Joe Average programmer is starting a new program from scratch and doesn't really know how to manipulate the syntax of the language to achieve what he wants. In that situation, programming in LISP is indeed less understandable than an imperative language. There is a bit of a learning curve for the process of bootstrapping the language to meet your problem.

While Swift and Rust are indeed strong contenders, each with its unique advantages, it's essential to consider the specific needs of your project when choosing the right language. Interestingly, a similar balance between flexibility and structure is also discussed in AI-driven technologies, such as [SPAM--Removed by moderator] where adaptability and automation are key factors.
LISP is like a secret club—once you learn the handshake, everything makes sense. Until then, it’s just parentheses-induced suffering!
 
Last edited by a moderator:

Lt_Storm

Ars Tribunus Angusticlavius
18,019
Subscriptor++
That's why the Python innovation of indenting to create blocks is so great. Could that work for Lisp?
While good indentation is critical to making your Lisp readable, I don't think that syntactic white space would help much with Lisp. After all, you need some way to differentiate function / macro calls from symbol reference, and that is what the parentheses do, the first item after one typically* being a call and anything else being a reference.

Also, most of the time, you aren't writing blocks of statements in Lisp, like you would in a procedural language. Instead you end up writing a single statement that the data flows through. You can break it up a bit with let, but the overall paradigm is still less about writing a list of small steps and more about describing what those steps combine to do.

* unless someone is doing something with macros or you are using '
 

tarski001

Smack-Fu Master, in training
2
Excuse my naivete, my background is mostly doing statistical analysis, data wrangling, and some numerical analysis in Python, Matlab and similar. But, it seems like there is always tension between making domain specific languages designed for algorithms in a fairly narrow domain and general purpose languages (which could probably just be thought of as another niche). Where and how do you decide to address different domains with libraries versus a different language?
The numpy library for Python provides great functionality for scientific computing, but it also seems to break with Python's style. Python seems to avoid dealing with data types and bit width, numpy has a wide array of such types. Python is well suited for iteration, numpy is well suited to vector operations and iterating over arrays is generally discouraged. I'm not sure how much Python experience would aid someone looking at numpy heavy code. So why a library for Python, rather than a distinct language like Octave or Julia?
 

Lt_Storm

Ars Tribunus Angusticlavius
18,019
Subscriptor++
I wonder how well GAI can process natural language into machine code now.
Given ambiguity, I suspect not terribly well, at least, when not referring to something like a named algorithm. After all, it doesn't take much phone tech support to convince yourself that natural language isn't terribly good at such specificity and detail.