Live data from Hacker News

It's 2023, so of course I'm learning Common Lisp

log.schemescape.com

301–310 of 346 posts

Re: It's 2023, so of course I'm learning Common Lisp

#301

Wow, wasn't expecting to see my post on here! Eventually, I want to write a follow-up, but I'm still a beginner. Here's what I've liked about Common Lisp so far: * The condition system is neat and I've never used anything like it -- you can easily control code from afar with restarts * REPL-driven programming is handy in situations where you don't quite know what will happen and don't want to lose context -- for exam…

LISP continues to be a very interesting language. But REPL development is a mixed blessing. There are many situations where you want to start from a blank slate with no previous state. LISP would be a more practical language if it included a trivial option to make that possible.

I wish there was some, even theoretical, effort to fix this. It's a crossdomain issue, even react in a way deals with that.

Re: It's 2023, so of course I'm learning Common Lisp

#302
post #168

Earlier quoted context omitted.

Common Lisp programs run by default in a way that calls to undefined functions are detected. Here the Lisp simply tries to look up the function object from the symbol. There is no function, so it signals a condition (aka exception). The default exception handler gets called (without unwinding the stack). This handler prints the restarts and calls another REPL. I define the function -> the symbol now has a function de…

>Common Lisp programs run by default in a way that calls to undefined functions are detected. Cool so what you're telling me is that by default every single function call incurs the unavoidable overhead of indirecting through some lookup for a function bound to a symbol. And you're proud of this?

That depends. The Common Lisp standard says nothing on the subject. CMUCL[1] and its descendent SBCL[2] do something clever called local call. It's not terribly difficult to optimize hot spots in your code to use local call. Outside of the bottlenecks, the full call overhead isn't significant for the overwhelming majority of cases. It's not like full call is any more expensive than a vtable lookup anyhow.

[1] https://cmucl.org/downloads/doc/cmu-user-2010-05-03/compiler...

[2] https://www.sbcl.org/manual/#Miscellaneous-Efficiency-Issues

Re: It's 2023, so of course I'm learning Common Lisp

#303

Earlier quoted context omitted.

At no point in time did I claim to know lisp well. I stated my familiarity at the outset. But what you all did was claim to know a lot about every other interpreted runtime without a grain of salt. >Next you can find out what optimizing compilers do to avoid it, where possible or where wanted. But compilers I am an expert in and what you're implying is impossible - either you have dynamic linkage, which means symbol…

What you're missing is that, unlike any other commonly used language runtime, compilation in CL is not all-or-nothing, nor is it left solely to the runtime to decide which to use. A CL program can very well have a mix of interpreted functions and compiled functions, and use late or eager binding based on that. This is mostly up to the programmer to decide, by using declarations to control how, when, and if compilatio…

It should also be noted that by spec symbols in the system package (like + and such) should not be redefined. This offers “unspecified” behavior and lets the system make optimizations out of the box.

Outside of that you can selectively optimize definitions to empower the system to make better decisions at the cost of runtime protection or dynamism. However these are all compiler specific.

Re: It's 2023, so of course I'm learning Common Lisp

#304
post #136

Earlier quoted context omitted.

Cl Condition system + repl = godmode. Your software crashes? Do you go back and set a breakpoint? No, because you’re already in the stacktrace in the repl exactly where the crash occurred. You fix the code, reload it, tell it to ether run where it left off, or restart from an earlier point.

Flask and Django have the exact same functionality - I've already said that this thing you guys keep talking is just a matter catching exceptions. https://flask.palletsprojects.com/en/2.3.x/debugging/ https://docs.djangoproject.com/en/dev/ref/settings/#debug

That is definitely not the same. I write a lot of python code and the interpreter / interactive development is just not as good as it is in Common Lisp.

To my knowledge there’s no real “mainstream” language that goes all in on interactive development. Breakpoints and traceback are all perfectly cromulent ways to debug, but it’s really not the same, sadly.

Re: It's 2023, so of course I'm learning Common Lisp

#305

Earlier quoted context omitted.

No.

Can you explain why this is not ? Code injection in production environments is generally considered an easy attack vector. Lots of CVE's around this in other language SDK's that have been ironed out over the last decade and half. I don't think Common Lisp gets "special protection" here or does it ? Unless you are restricting this to only development in which case there are a lot more languages other than common lisp…

> Lots of CVE's around this in other language SDK's that have been ironed out over the last decade and half

Like what? The only notable one I know of is log4shell. And no one advocates not to use java because of rce. Nor javascript, nor python, nor erlang. Compare with c...

Re: It's 2023, so of course I'm learning Common Lisp

#306
post #244
post #64

Earlier quoted context omitted.

See also advertising. C++ and Java had enormous advertising budgets, while Common Lisp had virtually none. For years, virtually every programming book and magazine was touting C++ and then later Java. Every conference, every keynote, everything a CTO might ever read or notice was telling them to use C++ or Java.

C++ itself never had a marketing budget! The nearest you might find is marketing for implementations back when people paid for programming languages, but the only surviving one of those is really Visual Studio. Lisp has had decades to break out of its niche if it delivered a really advantageous solution, but somehow that never happened.

> Lisp has had decades to break out of its niche if it delivered a really advantageous solution, but somehow that never happened.

I think a huge part of it is that it is not immediately obvious that one needs what Lisp offers, and by the time the system has grown to the extent that the need is obvious, it has also grown to the extent that one no longer sees the fores for the trees. One doesn’t think ‘oh man, I need garbage collection’; one thinks, ‘oh man, I need to manage malloc and free better!’. One doesn’t think, ‘oh man, dynamic scope would really fit this problem well’; one thinks ‘oh man, I need dependency injection.’ Peter Norvig famously noted that 16 of the original 23 design patterns were invisible or simpler in dynamic languages such as Lisp†. Heck, there was a time when one couldn’t rely on recursion, or even conditionals! But the programmer who has managed to get stuff done without recursion, or without conditionals, or without macros doesn’t really see the point. He’s even worried: those things may add too much expressivity to the language. Why, folks could write unmaintainable code with them!

Of course, folks write unmaintainable code without them, too …

Anyway, I think a huge issue is one of education and experience. Ours is a massively growing field. The vast majority of folks are juniors, and don’t know any better; a portion of their education was miseducation. The seniors often have one year of experience, twenty times (rather than twenty years of experience). Objective standards are rare to nonexistent. Norms and standards are absent.

But yeah, when I’m working on a large project in a language other than Lisp, I often think, ‘man, this would be so much easier in Lisp!’ or even ‘man, this would be practical in Lisp!’ (because anything is possible in a Turing-complete language …).

†: https://norvig.com/design-patterns/ppframe.htm

Re: It's 2023, so of course I'm learning Common Lisp

#307

Earlier quoted context omitted.

Okay well when pytorch, tensorflow, pandas, Django, flask, numpy, networks, script, xgboost, matplotlib, spacy, scrapy, selenium get ported to lisp, I'll consider switching (only consider though since the are probably at least another 20 python python packages that I couldn't do my job without).

For the sake of anyone reading this thread who isn't in the know: many of these libraries are really written in C/C++ and have Python bindings.

i said ported not implemented; the likelihood that any of those libraries sprout lisp bindings is about as likely as them being rewritten in lisp. so it's the same thing and the point is clear: i don't care about some zany runtime feature, i care about the ecosystem.

Re: It's 2023, so of course I'm learning Common Lisp

#308

Earlier quoted context omitted.

My Youtube channel: https://www.youtube.com/channel/UCHNK9EcrAwP7djlwQN4C_tg

Well, did you watch the recommended tutorials? Or are you one of those artists that don't watch their own work :-)?

If that was intended for me, I rarely watch my own videos. Only when I want to check on something. Don't like the sound of my voice. :)

Re: It's 2023, so of course I'm learning Common Lisp

#309
post #230

Earlier quoted context omitted.

I always find it odd that people say this. If stack doesn't matter than why not start writing machine code again?

That's not a good faith interpretation given the near infinite amount of options for conjuring up your favourite moneyprinting system of choice besides "machine code". SBCL is about the most arcane option you can pick and even that can work, which I think actually proves the point: it doesn't matter to any significant degree (anymore).

How else is one meant to read that language doesn't matter?

You can hook into anything that runs in Linux since it's abi is rock solid so the excuse of not being able to use the usual tech stacks doesn't hold water either.

Re: It's 2023, so of course I'm learning Common Lisp

#310
post #230

Earlier quoted context omitted.

I always find it odd that people say this. If stack doesn't matter than why not start writing machine code again?

I think they meant the stack doesn’t matter in the sense of “which stack you choose from the options available”, rather than “whether you choose a stack versus writing machine code”.

You can hook into the abi for software that runs in Linux trivially. So why isn't machine code acceptable? When you give the honest answer you see why the majority of languages aren't acceptable either.
Post reply on HN