Live data from Hacker News

Why I still Lisp

mendhekar.medium.com

231–240 of 240 posts

Re: Why I still Lisp

#231

> Languages based on the λ-calculus make it really easy to “play back the code” in your head. This really depends on the expression.. I've seen behemoth expressions such that you have no choice but write down intermediate results, or start explicitly breaking it down into sub-bindings so you could step through the code. And yes, you can usually step through subexpressions in the debugger, but if you have to debug any…

> I also noticed there is a tendency in lispy languages to avoid introducing variable bindings just for the sake of naming the subexpression, because it often comes with a `(let ((name (subexpression))) rest-of-code)`, which also results in extra tabulation for the rest of the body. Compare with variable introduction in languages like python/js/c++/rust, etc., where such thing wouldn't cause touching the rest of the…

In some schemes, you can have defines also in expression context. You can even add it by redefining a couple of standard forms.

Our scheme of choice, guile, introduced it in guile 3.

Re: Why I still Lisp

#232

Earlier quoted context omitted.

> This underlines the fact that Lisp projects can very easily end in spectacular disasters. I've been following HN since 2014 and haven't seen any submission about such a thing. The closest was some article or comment from someone who worked at Cycorp, about some horrors of the legacy code base. Here it is: https://news.ycombinator.com/item?id=21783828 "... the biggest mess I have ever seen by an order of magnitude"…

Not surprising since LISP isn’t used much.

Still, for some example companies: https://github.com/azzamsa/awesome-lisp-companies

Re: Why I still Lisp

#233
post #203

Earlier quoted context omitted.

Perhaps Babashka[0]? It sounds like the closest thing to what you want =)... Alternatively you could just use cursive[1] or vscode[2] and follow the REPL guide[3]? There's Racket, which has it's own built in environment[4]. Perhaps you'd prefer Common Lisp[5] instead, I don't believe you need to use emacs? There are options =)... - [0]: https://github.com/babashka/babashka - [1]: https://cursive-ide.com/ - [2]: https…

So basically clojure x 5 and racket x 1. But what can I actually do in practice day to day?

Well I'm suggesting more clojure things because I know clojure, I've used a little of racket and it was fun, as well as done very little common lisp =)...

I'm not sure what you mean by practice day to day? These are all things that you could work on in various ways on a daily basis if you want?

Or do you mean kata-like things?

If so there's 4clojure[0] or codewars[1], which does racket[2] and clojure[3] alongside a host of other stuff.

If instead you're looking at a suggestion of what to work on, just pick a small project and regularly work on it, I've done lots of small data processing tasks, as well as developing small games, pick anything that interests you and play with it.

I mean Mazes for Programmers[4] is a great book, perhaps rewrite it in any language that interests you?

If that's not quite what you want, can you please clarify?

- [0]: https://www.4clojure.com/problems

- [1]: https://www.codewars.com/

- [2]: https://www.codewars.com/?language=racket

- [3]: https://www.codewars.com/?language=clojure

- [4]: https://pragprog.com/titles/jbmaze/mazes-for-programmers/

Re: Why I still Lisp

#234

Earlier quoted context omitted.

That's a common meme but there's not much evidence for it. Java has the syntax it does because it's based on C++. It is verbose because (a) C++ is verbose and (b) it insists on everything being inside a class. The latter is a reasonable choice given that the underlying VM needs some unit of linkage and scope ... sort of like criticising C and C++ for requiring that everything be inside a function, but there are reaso…

I really read that big companies, for logistics reasons, prefer verbose, boilerplate-full languages because it slows down mistakes. Not only because the pace of evolution in the language is better for long term careers.

I don't think that's really true. I think it's more the case that the sort of languages that have the features large teams need have tended historically to be verbose, and some people conflated the two together. For instance lambdas made Java less verbose and there was no pushback from enterprises, which you'd have expected if they actually loved verbosity. Kotlin is also doing great in big companies and conciseness is one of its selling points.

Re: Why I still Lisp

#235
post #228
post #223

Earlier quoted context omitted.

My point is that this: > Most implementations of Common Lisp prevent shadowing builtin symbols. is irrelevant. It's actually irrelevant for two reasons. First, the example under discussion was SQUARE which is not a CL builtin, and second, even if it was, you could just do this: Just make your own package and do: (in-package :my-package) (defmethod square ((n number)) (* n n)) Now you can extend SQUARE to work on thin…

Oh that's the misunderstanding, I was talking about overloading of the '*' operator and the consequent confusion, not overloading of 'square'.

* is not an operator in Lisp. It's a function. Lisp doesn't have operators.

To be more precise, cl:* is a function. But you can make a symbol named "*" in another package and define it however you like.

Re: Why I still Lisp

#236
post #80

Earlier quoted context omitted.

And then if you don't test that Ada code, you blow up your Ariane 5.

https://www.researchgate.net/publication/220475937_Design_by... For the record: that was ages ago, the language has improved a lot since then. Ada 2012 includes features for contracts, for example. Read the "Preface" of "Programming in Ada 2012" for details. :)

The Ariane 5 failure was due to the faster trajectory of that launcher causing an integer overflow that the Ariane 4 (which the software was cribbed from) did not experience. I'm not clear how you encode that in a contract.

The sad thing about this is that if that code had been in (say) C the launch would have been fine, since no integer overflow would have been trapped, shutting down the guidance computer.

Re: Why I still Lisp

#237

Earlier quoted context omitted.

When would shadow binding help create more readable code? (I agree with everything else in your post)

I think it would do that, if in the inner scope, you only need a part of something from the outer scope. Lets say you have a list of things and they have the name according to what they are, lets use "things" as a placeholder. Then in the inner scope, you are still working with "things", just not all of the outer scope, but for reading the code of the inner scope, it does not matter. You are still working with "thing…

Thanks

Re: Why I still Lisp

#238

> Call-by-value > Mostly Functional > Dynamically Typed Sounds a bit like POSIX shell. Yeah, I know that especially people doing functional programming do not want to be compared to shell scripters, but since I know how horrible shell scripting is, I wonder if there could be a future, where a proper, mostly functional language could be the successor of the very practical bash. I mean, if we aren't doing anything soon…

Maybe have a look at Closh [1], a clojure based shell [1] https://github.com/dundalek/closh

I think my problem is less, that there are no alternatives you can setup yourself, but more, that there is no useful standard ;-)

But having a list of good alternatives if probably good too.

Re: Why I still Lisp

#239
post #233

Earlier quoted context omitted.

So basically clojure x 5 and racket x 1. But what can I actually do in practice day to day?

Well I'm suggesting more clojure things because I know clojure, I've used a little of racket and it was fun, as well as done very little common lisp =)... I'm not sure what you mean by practice day to day? These are all things that you could work on in various ways on a daily basis if you want? Or do you mean kata-like things? If so there's 4clojure[0] or codewars[1], which does racket[2] and clojure[3] alongside a h…

Thank you, all your recommendations are well received. I actually program a lot, these days in python for data science and I can do pretty much anything with it. But I am drawn to lisp and started the SICP book. But other than really personal projects and self explorations (which I also did with haskell, julia, rust, coq) I struggle to find a way to use a form of lisp for something I can do in work every day other than configuring emacs (which is not as bad). I think I have to agree with your point that clojure is the most practical option and fit for practical day to day use, cause it is lisp with all lava libraries. In the end it is the libraries... I guess my question should have really been what lisp based frameworks are there for data science, maybe.

Re: Why I still Lisp

#240
post #233

Earlier quoted context omitted.

Well I'm suggesting more clojure things because I know clojure, I've used a little of racket and it was fun, as well as done very little common lisp =)... I'm not sure what you mean by practice day to day? These are all things that you could work on in various ways on a daily basis if you want? Or do you mean kata-like things? If so there's 4clojure[0] or codewars[1], which does racket[2] and clojure[3] alongside a h…

Thank you, all your recommendations are well received. I actually program a lot, these days in python for data science and I can do pretty much anything with it. But I am drawn to lisp and started the SICP book. But other than really personal projects and self explorations (which I also did with haskell, julia, rust, coq) I struggle to find a way to use a form of lisp for something I can do in work every day other th…

Oh! Well perhaps you'd like this[0]?

The library author wrote two books as well[1][2].

Full disclosure, I've not used it, primarily because I've not yet had a chance to try it =)...

- [0]: https://neanderthal.uncomplicate.org/

- [1]: https://aiprobook.com/numerical-linear-algebra-for-programme...

- [2]: https://aiprobook.com/deep-learning-for-programmers/

Post reply on HN