3 ms·
Had a PalmPilot taped to a modem that did our auth. Lisp made the glue code feel like play. No types barking, no ceremony—just `(lambda (x) (tinker x))`. We did
by DadBase 1y ago
Had a PalmPilot taped to a modem that did our auth. Lisp made the glue code feel like play. No types barking, no ceremony—just `(lambda (x) (tinker x))`. We didn’t debug, we conversed. Swapped thoughts with the REPL like it was an old friend.
- no_wizard 1y agoThough these are minor complaints, there is a couple things I'd like to change about a Lisp language. One is its the implicit function calls. For example, you'll usually see calls like this: `(+ 1 2)` which translates to 1 + 2, but I would find it more clear if it was `(+(1,2))` where you have a certain explicitness to it. It doesn't stop me from using Lisp languages (Racket is fun, and I been investigating Clojure) but it took way too long for the implicit function stuff to grok in my brain. My other complain is how the character `'` can have overloaded meaning, though I'm not entirely sure if this is implementation dependent or not
- DadBase 1y agoFirst time I saw (+ 1 2), I thought it was a typo. Spent an hour trying to “fix” it into (1 + 2). My professor let me. Then he pointed at the REPL and said, “That’s not math—it’s music.” Never forgot that. The '? That’s the silent note.
- no_wizard 1y agoIt's due to Polish notation[0] as far as I understand it. This is how that notation for mathematics works. I suppose my suggestion would break those semantics. [0]: https://en.wikipedia.org/wiki/Polish_notation https://en.wikipedia.org/wiki/Polish_notation
- DadBase 1y agoAye, Polish notation sure. But what he gave me wasn’t a lecture, it was a spell. Syntax mattered less than rhythm. Parens weren’t fences, they were measures. The REPL didn’t care if I understood. It played anyway.
- obi2kenobi 1y agoBeautiful. I wish I had more professors who expressed concepts poetically back when I was in school. That's the kind of line that sticks in your head.
- wdkrnls 1y agoR works exactly as you describe. You can type `+`(1, 2) and get 3 because in R everything that happens is a function call even if a few binary functions get special sugar so you can type 1 + 2 for them as well. The user can of course make their own of these if they wrap them in precents. For example: `%plus%` = function(a, b) { `+`(a, b)}. A few computer algebra systems languages provide even more expressivity like yacas and fricas. The later even has a type system.
- seanw444 1y agoSimilar in Nim as well.
- ckmate-king-2 1y agoIn Standard ML, you can do either 1+2 or op+(1, 2).
- int_19h 1y agoR is much crazier than that because even things like assignment, curly braces, and even function definitions themselves are all function calls. It's literally the only primitive in the language, to which everything else ultimately desugars.
- eyelidlessness 1y agoHow is it implicit? The open parenthesis is before the function name rather than after, but the function isn’t called without both parentheses. If you want to use commas, you can in Lisp dialects I’m familiar with—they’re optional because they’re treated as whitespace, but nothing is stopping you if you find them more readable!
- apgwoz 1y ago, is typically “unquote.” Clojure is the only “mainstream” Lisp that allows , as whitespace. Has meaning in CL and Scheme.
- kazinator 1y agoAncient LISP (caps deliberate) in fact had optional commas that were treated as whitespace. You can see this in the Lisp 1 Programmer's Manual (dated 1960). This practice quickly disappeared though. (I don't have an exact time line about this.)
- eyelidlessness 1y agoMy mistake! That’s what I get for not double checking… well… basically anything I think during my first cup of coffee.
- MarceColl 1y agoIt's not really implicit though, the first element of a list that is evaluated is always a function. So (FUN 1 2) is an explicit function call. The problem is that it doesn't look like C-like languages, not that it's not explicit. In theory ' just means QUOTE, it should not be overloaded (although I've mostly done Common Lisp, so no idea if in other impl that changes). Can you show an example of overloaded meaning?
- no_wizard 1y agoThere's an example I saw where `'` was used as a way to denote a symbol, but I can't find that explicit example. It wasn't SBCL, I believe it may have been Clojure. Its possible I'm misremembering. That said, since I work in C-like languages during the day, I suppose my minor complaint has to do with ease of transition, it always takes me a minute to get acquainted to Lisp syntax and read Lisp code any time I work with it. Its really a minor complaint and one I probably wouldn't have if I worked with a Lisp language all day.
- MarceColl 1y agothat's correct, but its not that it denotes a symbol as a different function of ', its the same function. Turn code into data. That's all symbols are (in CL at least). For example in a quoted list, you dont need to quote the symbols because they are already in a quoted expression! '(hello hola) ' really just says "do not evaluate whats next, treat it as data"
- MarceColl 1y agoto be a bit more precise, everytime you have a name in common lisp that is already a symbol. But it will get evaluated. If its as the first item of an evaluated list it will be looked at in the function name space, if elsewhere it will be looked up at the variable name space. What quote is doing is just asking the compiler not to evaluate it and treat it as data.
- codr7 1y agoSymbols are quoted representations of identifiers so it still does the same thing.
- bcrosby95 1y agofunc(a, b) is basically the same as (func a b). You're just moving the parens around. '+' is extra 'strange' because in most languages it isn't used like other functions: imagine if you had to write +(1, 2) in every C-like.
- panzagl 1y agoFirst person to ask for more parenthesis in Lisp.
- zelphirkalt 1y agoSurely you mean (+ (, 1 2)) ;)
- Reefersleep 1y agoIt's not implicit in this case, it's explicit. + is the function you're calling. And there's power in having mathematical operations be functions that you can manipulate and compose like all other functions, instead of some special case of infix implicit (to me, yeah) function calling, like 1 + 2, where it's no longer similar to other functions.
- owlstuffing 1y ago> No types barking No thanks
- codr7 1y agoCommon Lisp supports gradual typing and will (from my experience) do a much better job of analyzing code and pointing out errors than your typical scripting language.
- tmtvl 1y agoThe reason I switched from Scheme to Common Lisp was because I could say... (defun foo (x) (declare (type (Integer 0 100) x)) (* x (get-some-value-from-somewhere-else))) And then do a (describe 'foo) in the REPL to get Lisp to tell me that it wants an integer from 0 to 100.
- fud101 1y ago[flagged]
- DadBase 1y agoWat’s the sound of meeting something older than you thought possible. Lisp listened. Modem sang. PalmPilot sweated. We talked, not debugged.