News for hackers. Stuff that matters.
Re:Why Lisp? by Ginden on Friday November 12, 2021 @04:42PM (#29204882)
> programming languages where if you write code now - you will be able to compile and use that code ten years from now (a software lifecycle eternity)

Fun fact: code written in JavaScript in 1995 will work in 2021, after 26 years.

If you are talking about "good practices" - few weeks ago I worked with C code from 2001 and it was just awful. Yes, it compiles - but it wouldn't pass any modern code review.

Re:Why Lisp? by musicale on Friday November 12, 2021 @07:17PM (#29206105)
> Fun fact: code written in JavaScript in 1995 will work in 2021, after 26 years.

Sure, as long as you run it in Netscape Navigator 2.0.

In 2021 you're lucky if a JavaScript web app that worked fine on Tuesday still works on Wednesday. And shocked if it works in any browser other than Chrome.

Re:Why Lisp? by Ginden on Saturday November 13, 2021 @07:09AM (#29209226)
It's plainly untrue. I worked on ECMAScript proposals and TC39 takes backwards compatibility really seriously.

Browsers too take backwards compatibility very seriously and features stop working almost only if these are serious security holes.

Re:Why Lisp? by musicale on Wednesday November 24, 2021 @07:58PM (#29337101)
You're right about backward compatibility - and yet so many things break anyway. And many web apps of the past only worked on Internet Explorer (much in the way that modern web apps only work on Chrome.)

However, the thing that broke Tuesday's app on Wednesday was probably a library or framework change.

Re:Why Lisp? by lostcolony on Friday November 12, 2021 @11:33PM (#29207384)
That's the DOM manipulation and browser behaviors, not Javascript itself.
Re:Why Lisp? by kwhitefoot on Saturday November 13, 2021 @07:37AM (#29209341)
If you divorce JavaScript from the Dom you have removed it's entire reason for existence. So the dom is effectively part of the language. Just as the standard library is effectively part of C or Nim, etc. Without them they are considerably less useful.
Re:Why Lisp? by lostcolony on Saturday November 13, 2021 @01:51PM (#29212199)
You remove the reason -for its creation-. Not its reason for existence; Node is a thing, and doesn't touch the DOM. So, no, it's not effectively part of the language.
Re:Why Lisp? by kazinator on Friday November 12, 2021 @07:45PM (#29206269)
Ah, but code written in Common Lisp in 2021 will usually work in 1995, after -26 years.

:)

Re:Why Lisp? by pfdietz on Saturday November 13, 2021 @07:41AM (#29209367)
Aside from CL implementation bugs. The implementations had lots of them back then, even the commercial ones. Nowadays, they are much better. Decades of effort to make an implementation bug free and shiny will have its effect.
Re:Why Lisp? by throwawayapples on Friday November 12, 2021 @08:06PM (#29206371)
That really is amazing. Is it true, even "usually", for most types of code? Both forwards and backwards compatibility.. it's like the holy grail.
Re:Why Lisp? by kazinator on Friday November 12, 2021 @08:22PM (#29206450)
For most types of code, other than things like code which has dependencies on implementation internals (like extensions in SBCL for instance), or uses FFI to access platform libraries that didn't exist in 1995; that sort of thing.

ANSI CL was last ratified in 1994; there has been no standard language change, and the community language improvements are just macro libraries. You should be able to take your alexandria utilities library, or optima pattern matching or whatever back to 1995.

Re:Why Lisp? by pfdietz on Sunday November 14, 2021 @12:25PM (#29218699)
There are a few community improvements that are language extensions. The standard had no notion of multithreading, MOP was not in the standard, and packages really needed some way to avoid collisions of short package names (which lead to the de facto standardized package local nicknames.) Pathnames may also have seen some de facto standardization; they were poorly specified in the standard.
Re:Why Lisp? by koonsolo on Friday November 12, 2021 @05:27PM (#29205268)
Maybe the C code was just badly written
Re:Why Lisp? by dankoncs on Friday November 12, 2021 @05:33PM (#29205311)
Yep.

Use some of the -W* flags (-Wall -Wpedantic -Wconversion, ...) and specify the standard -std=c90.

Avoid undefined behaviors:

- https://en.cppreference.com/w/c/language/behavior

- https://wiki.sei.cmu.edu/confluence/display/c

(Also use cppcheck, valgrind, gdb, astyle, make, ...)

Done.

Fun fact: JS and C are both standardized by ISO.

Re:Why Lisp? by Asooka on Saturday November 13, 2021 @01:40AM (#29207930)
And always use "-fwrapv -fno-strict-aliasing -fno-delete-null-pointer-checks". Those are source of the hardest to reason about UB and the small performance benefit is not worth the risk. I would love to always be certain I haven't accidentally hit UB, but that's equal to the halting problem, so for peace of mind, I just ask the compiler for a slightly safer variant of the language.

P.S. and old code definitely needs them, as at the time compilers didn't optimize so aggressively and lots of code does weird stuff with memory, shifts, etc.

Re:Why Lisp? by throwawayapples on Friday November 12, 2021 @08:08PM (#29206383)
Have a look at Apache 1 (C) or KDE 1 (C++); it'd be interesting to see what you think of those codebases, and they can certainly predate 2001.
Re:Why Lisp? by voxl on Friday November 12, 2021 @07:06PM (#29206017)
Maybe it's next to impossible to write C code that isn't badly written
Re:Why Lisp? by FpUser on Friday November 12, 2021 @08:19PM (#29206437)
Or maybe we have too many developers that treat language of their choice as a religion.
Re:Why Lisp? by pjmlp on Saturday November 13, 2021 @03:09AM (#29208259)
>To encourage people to pay more attention to the official language rules, to detect legal but suspicious constructions, and to help find interface mismatches undetectable with simple mechanisms for separate compilation, Steve Johnson adapted his pcc compiler to produce lint [Johnson 79b], which scanned a set of files and remarked on dubious constructions.

-- https://www.bell-labs.com/usr/dmr/www/chist.html

Unfortunately since 1979, majority of C devs think they know better.

Re:Why Lisp? by koonsolo on Saturday November 13, 2021 @06:28AM (#29209074)
C code is of course close to the hardware, which as always, has benefits and drawbacks.
Re:Why Lisp? by hajile on Saturday November 13, 2021 @08:05AM (#29209461)
I was pretty sure that there were some subtle changes in ES5 and ES6 that were technically not backwards compatible (done because very little code depended on those behaviors)
Re:Why Lisp? by rmbyrro on Friday November 12, 2021 @05:11PM (#29205141)
Out of curiosity: would the 1995 JS code pass any modern code review?
Re:Why Lisp? by mr_toad on Friday November 12, 2021 @07:52PM (#29206306)
I’d imagine it would get pinged for using var instead of let or const. And depending on who’s doing the review they might not like ‘new’.
Re:Why Lisp? by FpUser on Friday November 12, 2021 @08:25PM (#29206465)
>"I’d imagine it would get pinged for using var instead of let or const."

This single thing in isolation should never cast code as good or bad.

Re:Why Lisp? by casion on Friday November 12, 2021 @05:17PM (#29205195)
JS from 2003 passed code review for me a few months ago... so, yes... maybe.
Re:Why Lisp? by np_tedious on Friday November 12, 2021 @06:55PM (#29205931)
Probably depends what it's doing. If it's interacting with HTML and manipulating the DOM then probably not
Re:Why Lisp? by helsontaveras18 on Friday November 12, 2021 @08:49PM (#29206589)
How do modern frameworks display content? Must be interacting with HTML and manipulating the DOM in some way.
Re:Why Lisp? by lostcolony on Friday November 12, 2021 @11:37PM (#29207411)
It's not whether they do, it's how they do.

For instance, in 2003 there was no such thing as a mobile phone; passing code review today is probably going to entail either being responsive, or directing to a mobile version when accessed from a mobile device.

Re:Why Lisp? by kgwgk on Saturday November 13, 2021 @04:45AM (#29208667)
Re:Why Lisp? by lostcolony on Saturday November 13, 2021 @01:48PM (#29212179)
Okay, I will clarify my hyperbole in the face of the pedantic - mobile phones did not provide ubiquitous, standardized approaches to browsing the web, such that UX guidelines for the web did not include them; media queries and such did not exist except as drafts, etc etc.