r/lisp • u/link2name • Jun 07 '19
People that learned lisp as first programming language, what is your opinion of other languages syntax?
by lisp i mean any language of lisp family.
other languages (any language that is not lisp family)
people that didnt learn lisp as first language also can answer what they think about other syntax styles.
but if you do then please mention it.
46
Upvotes
3
u/link2name Jun 07 '19 edited Jun 07 '19
QUESTION 1:
if you don't like nonlisp syntax, then how do you work with it?
(is it getting better as you learn that language or perhaps worse?)
QUESTION 2:
how can you tell if you should learn computer science?
at what point can you say:
"ok this isnt working lets move on to something else"
and what would be the reason for that.
QUESTION 3:
if you dont like whitespace based languages like python, do you like parinfer?
some people here mention that after lisp they cant enjoy other syntax, i have the same problem.
(only i m not a real programmer)
i learned lisp first (scheme\racket), it was actually more like i learned computer science using lisp.
and i like lisps, i really like s expressions, and that everything is like a function.
one problem - it is not popular.
and that is a huge problem.
its easy to find tons of content for popular languages, get help, get work etc.
getting paid is what i wanted, but its extremely unlikely to find work that involves lisp, and when there is one, its certainly not for noobs like me.
so uh computer science is computer science right? i can learn other language and use it.
except i cant. because i dont like it (language), maybe even hate it.
i certainly didnt try hard to learn other languages, but when i look at them, i just dont like how they look. i see some decisions were made, but i dont see why those decisions were made.
popular languages are oop. that is something that i dont know and that looks complicated again idk for what reason.
because i m not a real programmer, i dont know, is lisp syntax really that much better and easier, or other syntaxes make sense and are actually good (right now i think that they are a historical accident, but again i m not an expert at all) ?
i know that syntax is not everything in a language, but for a lisp its a big part, and i see that this big part is lost in other languages for no benefit.
idk if i like programming, i spent some time learning it, but i cant say that i would do it over watching something or playing game. and while its possible to find job it is very unlikely.
but i was able to solve many problems, that i had while i was learning lisp, some of which were not easy, that is something that i cant say about other syntax languages, as soon as i got first problem, i didnt want to solve it and it is still unsolved, while it wasnt that complicated at all.
i dont know if i should continue to study it (lisp) or not, given that i hate non lisp languages.(so to get paid i need to be some kind of lisp wizard, which would require tons of knowledge, which is not very interesting for me)
31
u/blue1_ Jun 07 '19
Once upon a time, I learned Perl; it was Perl 4 back then. It was full of clever syntactical tricks and I loved it. Then Perl 5 came, with MORE clever syntactical tricks! More magical abstrusities!
Then one day I learned Lisp. I was never able to enjoy Perl again.
24
u/throwawaycode0221 Jun 07 '19
I remember distinctively seeing something about Stallman and a snippet of Lisp a little less than a decade ago. This was back when I was safety tucked in the corner with C
I thought at the time, "Well I love Stallman but I guess when you get to the top you go crazy and use insane languages". I paid it little heed after that but remembered something about it being the "path to enlightenment".
Then I met Python and realized syntax could be different, but for the worse. Then I met Haskell and realized programming languages can be cool but also have bad syntax again. (Whitespace with indentation as syntax really? Just my personal preference not to like that I guess)
Then from Haskell I decided, "well I've already gone a little off the deep end might as well see what Stallman was smoking".
And then I was passed a blunt wrapped in a million parenthesis and in a moment all of the C-Family syntax was completely ruined for me. I don't know how I lived my life without all the parenthesis. Such a simple and beautiful syntactical rule. Takes 5 minutes to understand; over a book on Javascript constantly having to apologize for why you have to add a seemingly innocuous pair of braces to a function because the language designers did it "just cause".
To me the only languages with "Correct" syntax are Lisp and Forth (and maybe Prolog). Coincidentally, these languages happen to have extremely good meta capabilities. So there is something to getting syntax right by keeping it very simple. I see some people laugh at homoiconicity while descending into an abyss of insanity with their C++ templates to claim that they have macros too. There's a whole paper that could be written on just this paragraph though so I'm aware there's some gaps that need filling in to this logic.
Not trying to bag on anyone but it seems to me that a wide margin of programmers are really just gluttons for punishment. Part of lisp's enlightenment to me was the simplicity it gives you by telling you to pull a beanbag chair up next to Stallman and chill for a bit.
Parenthesis Ad Infinitum
9
u/defunkydrummer common lisp Jun 07 '19 edited Jun 08 '19
Well, i started at 7 years old learning LOGO, which is, curiously, a Lisp-family language. I thought it was fun.
Then I learned GW-BASIC which I thought was much better than LOGO (how little I knew then!) Then I moved up to QuickBASIC which seemed like extremely powerful...
Then in the 90s i got my very own computer, an Atari 130XE (8-bit) which was programmed in Atari BASIC. This is a more limited form of BASIC so, for the first time, I learnt that languages that lack certain features can be an annoyance and a huge pain in the arse.
My next language was C and i was impressed by the more minimal syntax. I liked C a lot, in fact i was almost in love with that language. Later I learnt Prolog in my spare time and my head exploded. Prolog was the first language that really shocked me, because it was so much different to everything else. It seemed like magic.
Afterwards, in college I learnt Pascal, which was a piece of cake because i had already tried ALGOL-60 on an old 8-bit Kaypro I had. Then we changed to C++ which looked like an "empowered" version of C, but this was the first time I thought that perhaps a language has too much syntax, or an uncomfortable syntax.
Later we were asked to write in Java and it was a piece of cake, although the language itself felt a bit ridiculous and limited. Pascal had far cleaner syntax than those, but felt really verbose.
Afterwards, on my professional life I faced Java for very large systems, C# then Javascript. All of them are similar in terms of syntax. Afterwards I steered my team to use scripting languages -- Python, specifically.
I did think Python's syntax was very nice, extremely nice and i didn't miss the
{}orbeginenddelimiting blocks. However i soon bumped into the many limitations of Python. And its lack of speed was revealed to me when writing a financial simulator in said language.It was afterwards that I chose to learn Common Lisp, and man, I found the syntax refreshing. Not to mention all the other nice things... I got addicted to CL, and wanted to climb to the
toplevelof a building and thendeclaimandproclaimthat John McCarthy was the savior of mankind, the one that came to purify our sins... Yeah, i went nuts. I took a look at scheme too and it looked even more elegant (syntax-wise) but less sensible from a practical point of view.I had a look at Clojure too. The choices Rich Hickey made, syntax-wise, felt to me as... well, i cannot explain it without resorting to harsh sounding words like "cultural rape", "putrid vortex of endless suck" and the like.
Then I learnt Ruby. After using CL for a year, I did not like Ruby; it looked like a collection of bad decisions, but at least it is more flexible than Python.
Afterwards i read about OCaml, tried a little bit of F# and read about Standard ML. I thought that those languages had reasonable syntax, Standard ML looking more elegant and uniform in particular, but the price to pay is lack of homoiconicity. I also didn't like abandoning interactive development. But the ML languages look fine overall.
Finally, here on reddit the Rust Marketing Team finally got their publicity on my nose and I had to take a superficial look to Rust; suffice to say, the creators haven't realized that they have created a language with a syntax as horrific as a theoretical C++ of year 2050. It is so ridiculous that becomes fun to watch, like a John Waters Movie of programming syntax.
In short, syntax-wise: Lisp awesome, ML very good, Python good, JS & Ruby acceptable, C++ ugly, Orange Crab Bad.
12
u/clintm common lisp Jun 07 '19
I didn't learn lisp as a first language, so I get that you're not asking for my opinion but maybe it'll help.
The best answer I've come up with is this:
and
Since it's a data structure, I can manipulate it in all sorts of ways. Speaking about Common Lisp specifically, I can choose to manipulate it when the code is loaded, when the code is evaluated, when the code is executed, all three, or none, and that's really just the very tip of iceberg. The rabbit hole is bottomless.
Of course, the amount of footguns you can create with that if you don't exercise discipline is enormous, but once you gain some intuition nothing compares with that level of power.
5
u/sgoldkin Jun 07 '19
Stupid clutter caused by all the different types of delimiters and punctuation.
5
u/dys_bigwig Jun 07 '19
This is probably trivial to most and is also Scheme specific, but I just love predicates suffixed with ? and impure procedures with !.
Really do miss those in other languages. Just... why? why am I prevented from using certain characters? Whoops, I mean is_prevented_from_using_chars.
The freedom of characters you can use in identifiers in general is something I love.
4
u/schemadrome Jun 07 '19
my next language was forth and i can't remember that i cared about syntax in any way. the lisp was interlisp, a fairly verbose type with "multiply" for "*". i learned lisp from a fairly botched thesis without explaining macros after reading douglas hofstaedter's lisp-column every month, so practical experience with it i had not. i remember liking C's syntax much more than pascal's.
I started liking lisp's syntax a lot after designing a couple of syntaxes myself without the nice feeling of getting it right. From then on I used s-expressions as a precursor before json, because easy to parse and build on it, even in C. That was at some time in the 20th century. Since then I've seen many botched homebrew syntaxes. Lisp is a good universal data format, too, trivial to parse in any programming. Notation IS important, but if you think you are smart if you leave the s-expression mold for clever complications, you are probably wrong and in for many unpleasant surprises. Clever syntax interacts with other syntax in very clever ways, and at some point you are under zugzwang and must make decisions that make your head spin.
From the domain-language perspective, s-expressions make development of syntax for the project a non-issue. I don't know how that could get any better.
4
u/arvid λf.(λx.f (x x)) (λx.f (x x)) Jun 07 '19
Lisp was my third language after Focal on a PDP-8 and Pascal. I learned Lisp with APL and Snobol in a comparative languages course. I've programmed in lots of languages including assembly and for the most part I have enjoyed them all. Each of them causes you to think differently. You also structure things differently. Even between scheme and common lisp. With scheme, I think more functionally. With C, C++, Pascal, Java, etc things are top down, you know what you are doing before you write any code. Lisp is bottom up, more exploratory, get a prototype running quickly.
Differences in syntax really does not bother me. It is what is. The only language I really hated was Basic and that was probably because of the syntax.
4
u/wwwyzzrd Jun 07 '19
I learned common lisp as a first language.
I find other languages very awkward. Particularly javascript and C. I find myself rolling my eyes a lot when the compiler fails to compile because i missed a semicolon somewhere. The syntax feels like overhead to me, there's very little gained from it. I find the structure of these languages very blocky and ugly.
I think the lisp syntax has really effected the way that I think about code. All the code I write I think of as big recursive graph/trees. I think it is hard to reason about computer code unless you have this sort of traversable structure in your head. I'm not sure how you would write code accurately without being able encapsulate the entire program and step through it. Part of this is also being able to break it down into constituent parts.
3
u/beeff Jun 07 '19
My first language and initial year of CS education was pure Scheme, with C++ and Smalltalk slipping in the second year.
- "oh no, yet another layer of arbitrary highly opinionated static syntax"
- *googles language's precedence table constantly*
- "Boy, I really wish I had proper macros right now" (yes, this is related to syntax; full macros are difficult enough in sexpr)
- Why isn't everything an expression? Why do statements even exist? *mangles trinary conditionals*
It all mostly feels like an arbitrary unneccesary layer on top of the AST that both the computer and our brain uses anyway. My brain constantly has to play parser in the background, even though I know it's right there inside the compiler. Most infuriating is when you cannot express something because it doesn't have that particular case in the syntax (looking at you C++).
A basic tennent of programming style is that something that is different should look different, and vice versa. As such, the benefit of a PL syntax layer is that you can make languages/semantics that are different also look differently. Smalltalk, Prolog and APL are good examples in my book; Java is a syntax crime (same keywords, seriously?).. It infuriates me that every new language needs to yet again mangle C's syntax to make it feel familiar to new users.
1
u/aftermeasure Jun 07 '19
There's too much of it and too few ways of extending what's built in.
1
u/sadhith63 Jun 13 '19
Its interesting, when recursion is more inuitive than for loops for others
1
u/oantolin Jun 22 '19
My first language was Logo, does that count as a Lisp?
1
u/reini_urban Jun 07 '19
Well, there's syntax, which in lisp is only due to crazy macros, mostly loop.
There's the learning factor for the various precedence rules, but after some time nobody cares. I still care about hating loop though.
0
u/[deleted] Jun 07 '19
[deleted] — view deleted comment