this post was submitted on 12 Nov 2023
1 points (100.0% liked)

Lisp

53 readers
3 users here now

founded 1 year ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] Nondv@alien.top 1 points 1 year ago (1 children)

I mean, without any definitions I'd say JavaScript.

It's kinda like Scheme: first class functions, vars and functions share namespace, etc

load more comments (1 replies)
[–] lispm@alien.top 1 points 1 year ago (1 children)
[–] everything-narrative@alien.top 1 points 1 year ago (1 children)

This.

Smalltalk's metaprogramming through classes-as-objects and code-as-objects is very much comparable to Lisp's.

Ruby is a modern example, with Pascal/Algol-like syntax with lots pf sugar. It has some very rich metaprogramming.

[–] lispm@alien.top 1 points 1 year ago

Smalltalk also has similar interactive development styles. One can build the application incrementally piece-by-piece. It has a residual graphical integrated development environment -> the development environment is a part of the program. It uses late-binding via message-passing. It starts and saves images (-> dumps of the heap contents, data and code). It is introspective & reflective (one can find out about the running program and can change it).

[–] mansetta@alien.top 1 points 1 year ago

Just by the feel of it, Forth.

[–] MilanorTSW@alien.top 1 points 1 year ago

Haskell or Julia come to mind.

[–] GunpowderGuy@alien.top 1 points 1 year ago

I Heard javascript started as a lisp or scheme but has it's syntax changed

[–] digitalghost0011@alien.top 1 points 1 year ago

I think Clojure is a lisp but some people say Clojure is not because of the map and vector literals. If you agree with them definitely Clojure. Probably Elixir if you disagree.

[–] FoldingF@alien.top 1 points 1 year ago

Elixir or Ruby

[–] Laugarhraun@alien.top 1 points 1 year ago

Many modern languages share some Lisp features. Ruby and Python come to mind.

In the vein of "the world is not what you think" but very different from Lisp I'd say Forth. Implementing a Forth is a fun exercise.

[–] kagevf@alien.top 1 points 1 year ago

Mathematica

[–] cdlm42@alien.top 1 points 1 year ago

Maybe Dylan, if you accept it as a non-Lisp?

[–] Megasphaera@alien.top 1 points 1 year ago (2 children)
[–] tr4zodone@alien.top 1 points 1 year ago
[–] fogus@alien.top 1 points 1 year ago
[–] inawarminister@alien.top 1 points 1 year ago

Julia is implemented in Scheme I believe, and it had (has?) a lisp-style homoiconic syntax compiler still inside.

Elixir, which people mentioned, is not homoiconic, but all of its syntax are implemented in a list of threes [module, function-name, arity], and so its macros are quite powerful and hygienic (*). It has a really great REPL story (you can connect through IEX to any Actor in the server). Elixir itself is 100% dynamic functional paradigm, just like Scheme* or Clojure. And Message-Sending paradigm is ridiculously powerful.

I believe Nim is also interesting, with its heavy emphasis on macros as a way to do systems programming. No homoiconity here too though.

[–] Shinmera@alien.top 1 points 1 year ago (1 children)
[–] sdegabrielle@alien.top 1 points 1 year ago (1 children)

parenthesized prefix notation

[–] theangeryemacsshibe@alien.top 1 points 1 year ago (2 children)

Behold, a Lisp:

(identification-division
 (program-id :hello-world))
(procedure-division
 (main
  (display "Hello, world!")
  (stop run)))
load more comments (2 replies)
[–] kishaloy@alien.top 1 points 1 year ago (1 children)

Julia, Elixir

...

C++ 40

[–] nakuaga@alien.top 1 points 1 year ago

C++ 40

Greenspun's 10th rule

[–] jwezorek@alien.top 1 points 1 year ago

i think for something to be like Lisp without actually being Lisp it would need to be functional and feature homoiconicity, or at least something like homoiconicity.The only language like that, that many people would not call a Lisp anyway, is Julia.

EDIT: wikipedia says Elixir too but I don't really know anything about Elixir...

[–] joesb@alien.top 1 points 1 year ago
[–] dajoy@alien.top 1 points 1 year ago
[–] jose_castro_arnaud@alien.top 1 points 1 year ago (1 children)
[–] Odd_Chemistry3648@alien.top 1 points 1 year ago
[–] seaborgiumaggghhh@alien.top 1 points 1 year ago

I think that MLs “feel” a lot like Lisp, they are missing the obvious macro systems, but have few syntactic constructs and control flow is mostly function application. Namely SML, OCaml, and Haskell. I haven’t touched any others.

Others have said Elixir and to some extent I agree, but maybe the Ruby syntax throws me off.

[–] JackoKomm@alien.top 1 points 1 year ago (1 children)

EcmaScript. It Was planned with scheme in mind and you can still feel it today. It is funny that many things people dislike about it have it's origin in scheme. One of the problems is that it doesn't look like a LISP language and people just see it like a Java like language. If they would familiarize themselves with the concepts, they would probably get the idea behind the language.

[–] diddle-dingus@alien.top 1 points 1 year ago

Dynamic scope, "this", implicit casting. These are not scheme ideas.

[–] mndrix@alien.top 1 points 1 year ago
[–] ShacoinaBox@alien.top 1 points 1 year ago

red/rebol lol its not even a question

[–] green_tory@alien.top 1 points 1 year ago (1 children)

Janet.

It's not a lisp or lisp dialect because it is not built around lists. It doesn't even have cons cells.

[–] scheurneus@alien.top 1 points 1 year ago (3 children)

I don't know that much about Lisp, but I don't understand this obsession with cons cells and (linked) lists. A cons cell is nothing more than a 2-tuple, which is equivalent to a 2-element array (and Janet has arrays!).

From a programmer's perspective the difference between an array and a list is also, I would say, very minor. So why is using linked lists instead of arrays a critical part of a Lisp?

[–] daybreak-gibby@alien.top 1 points 1 year ago

I am pretty late to the Lisp world myself, but this cons obsession doesn't make any sense to me either. I think it is useless gatekeeping.

My personal definition is if someone saw it would they call it a Lisp? Janet is definitely closer to a Lisp, than an ML or C-styled language. Therefore, it is a lisp.

[–] kagevf@alien.top 1 points 1 year ago (1 children)

I think it's because it's more natural to represent a tree with a linked list. The body of Lisp code is also a tree - some even say an "abstract syntax tree", but that's not fully accurate - which facilitates the syntax manipulation done with macros.

[–] green_tory@alien.top 1 points 1 year ago

Not just trees; any operation that involves mutating or manipulating list-like structures is more efficient than arrays.

Some examples:

Removing an element is delinking a single cons cell, vs either copying to a new array or shuffling all subsequent elements left. It also doesn't break any references to list cells, even the removed cell.

Slicing, at minimum, only requires having the cons cell at the new head of the list; rather than either a special datastructure to represent a slice, or copying to a new array.

Filtering means pulling cons cells from a nursery on an ad-hoc basis, using them to collect filtered elements into a new list of unknown length. With an array, you need a pre-allocated buffer that either sets a limit on the size of the filtered set, or requires reallocation on resize with a O(n) copy.

Just, in general, you can be a lot more relaxed with flinging data around lists without having to think about the algorithmic overhead of allocating, reallocating, copying and shuffling arrays.

[–] green_tory@alien.top 1 points 1 year ago

If you were to use Janet arrays as one uses lists in a lisp, then you'd quickly find yourself in a performance tar pit. Arrays would be frequently allocated, freed, resized, copied, and so forth.

A linked list built around cons cells allows slicing, augmentation, filtering, and so on almost for free.

That means writing in a proper lisp lends itself towards almost thoughtlessly mutating and manipulating lists; whereas writing code in Janet means spending more care about what you're doing with the data structure.

Concatenative languages have the same sort of homoiconiciy, e.g. Factor or Darhflow's Elymas.

FORTH has the same kind of minimalism as McCarthy's EVAL.

[–] catladywitch@alien.top 1 points 1 year ago

Lua - uses tables (hashmaps) for everything like Lisp uses lists (but not homoiconic), and has some functional features including first-class functions and tail call optimisation.

[–] Aidenn0@alien.top 1 points 1 year ago
[–] theangeryemacsshibe@alien.top 1 points 1 year ago
[–] Windblowsthroughme@alien.top 1 points 1 year ago (1 children)

Rhombus is built on racket which is built on scheme

load more comments (1 replies)
[–] daelin@alien.top 1 points 1 year ago

Definitely JavaScript, but I think there is a really strong argument for Python.

There is a language called Hy, which is a Clojure-like LISP that runs on the Python runtime, fully interoperable with Python code in the same runtime. That is, you can freely import between Hy and Python code. Hy also has macros. IIRC they just use the Python standard library for all of this.

Python actually has really powerful metaprogramming features, especially today. They’re just not homoiconic without Hy.

Where Python—CPython at least—falls short is that you can’t REALLY do something like replace the exception handling system. It’s not turtles all the way down. But the runtime is surprisingly close in for most use cases.

[–] AuroraDraco@alien.top 1 points 1 year ago

Julia is very inspired by Lisp and has a lot of things in common with it. I doubt its the closest, but it's not too far

[–] sdegabrielle@alien.top 1 points 1 year ago

How about FORTRAN…because the bar is so low that pretty well everything is a Lisp 🤣

Lisp is an influentual - like smalltalk you see it’s influence in every modern programming language - but unpopular.

If you define Lisp as parenthetical syntax you can include Common Lisp and Scheme implementations, Clojure, LFE, and the Racket Lisp dialects.

Rhombus, Haskell, Elixir, Ruby, Dylan, Smalltalk, R, Julia, Rust, TCL, the ML’s, Prolog, Wolfram and Javascript are not Lisps.

All important languages that don’t need validation with a nonsensical ‘lisp’ label.

[–] myTerminal_@alien.top 1 points 1 year ago

JavaScript?

[–] timmem@alien.top 1 points 1 year ago (1 children)

Lua. The great secret of Lua is that it is lisp, without brackets, without bloat.

load more comments (1 replies)
load more comments
view more: next ›