Live data from Hacker News

The Idea of Lisp

dev.to

211–220 of 348 posts

Re: The Idea of Lisp

#211

Earlier quoted context omitted.

It's the same thing. It's a type with only a single value.

`void` in C does not have a value. You can't make a variable and put a void in it because there is no such object as "void".

Yes, and () isn't void; the poster above me is wrong. Void is...the absence of a type? It's awkward.

However, () and Unit are.

Re: The Idea of Lisp

#212

Earlier quoted context omitted.

I'd be interested to learn more about your language. Is there a web page about it, or a paper? Are you the D Clark who's at UCL? The way things are now can be changed. For most applications users care more about response times than CPU clock rates. Hardware has speeded up by several powers of ten (Moore's law) but software has at the same time slowed down (Wirth's law), resulting in little if any net gain, and that h…

David Clark is like John Smith and no, I am not any famous person but I have been around the micro computer world for a very long time (1975). My website is www.rccconsulting.com where you will find an essay on the data structure I mentioned here called SLIST and some documentation and high level design for the system/language I am currently developing called MAX. Users do care more about response times (as you say)…

There's already a language called Max: https://cycling74.com/products/max/#.WFRNp-wWVpg

Your SLIST sounds similar to data structures which go by various names in different languages, e.g. list in Python or ArrayList in Java. Common Lisp vectors support that functionality too.

Your VCHAR presumably works in a similar way? I agree ASCIZ is a very inefficient way of representing strings, unless they're guaranteed to be very short.

Re: The Idea of Lisp

#213

Earlier quoted context omitted.

And if you want a new array whose first element is increased by one, you either have to allocate space for the entire array, modify the array, or use a different data structure.

No you don't, you merely need each index into an array to be a monad over all possible values it can contain. An array is itself and modifications are (take as arguments and return) its indices.

And how is that implemented under the hood?

Re: The Idea of Lisp

#215
post #148

Earlier quoted context omitted.

I designed and built a statically-typed F-Expr LISP for my thesis, using some partial AST evaluation to trace and ensure every value had at least an initial value, and from that, type inference. So it looked like: (define fib (lambda (n) (let loop ((a 0) (b 1) (n n)) (if (= n 0) a (loop b (+ a b) (- n 1))))) Which would do nothing by itself, and be eliminated as dead code unless called. If we called it with: (fib 10)…

Do you happen to have a link to your thesis?

Unfortunately not.

I had to surrender publishing rights, and the university only publishes about 10 submissions a yeaar... So unlikely to appear anytime soon.

Re: The Idea of Lisp

#216
post #92
post #57

Earlier quoted context omitted.

Common Lisp, Racket, and Clojure all have optional static typing.

They have gradual typing but I believe they're still enforced as runtime contracts, making them not static types.

In a Typed Racket program that does not import any untyped racket code, there is no runtime enforcement. Runtime contracts are only introduced at the boundary between typed and untyped code. This allows programs to be soundly transitioned from untyped to partially typed to fully typed.

Re: The Idea of Lisp

#217

Earlier quoted context omitted.

Rust also has (almost) everything being an expression - things like this aren't uncommon: let x = if something { foo() } else { bar() } Things which don't have a logical value evaluate to `()` (the empty tuple), I believe.

> Things which don't have a logical value evaluate to `()` (the empty tuple), I believe. If Rust follows Scala then `()` is not the empty tuple, but rather Unit (void in C*).

> For historical reasons and convenience, the tuple type with no elements (()) is often called ‘unit’ or ‘the unit type’.

https://doc.rust-lang.org/reference.html

Re: The Idea of Lisp

#218
post #3

Lisp was developed because McCarthy needed a tool for experimenting with AI. Found a video of McCarthy talking about AI: https://www.youtube.com/watch?v=Ozipf13jRr4 And if anyone cares, here is nice Shirt with McCarthy on it ;) https://www.teepublic.com/t-shirt/666689-john-mccarthy-lisp-... I think it should be mandatory for CS students to implement their own little Lisp using the building blocks McCarthy described!…

> Java and ist crappy OO

* There are those for whom writing an AST acting on lists of lists of lists comes naturally. They have Lisp. For us idiots who model things in terms of state and behavior, and who prefer to let the compiler do the hard work of figuring out an AST representing our ugly, step-by-step solution, there is "crappy OO".

Re: The Idea of Lisp

#219
post #209
post #70

This article has many misstatements in its first half. > John McCarthy wrote 6 easy things in machine code, then combined them to make a programming language. John McCarthy didn't implement Lisp in machine code. Steve Russell did. Implementing Lisp properly in machine code is not easy; you have to write a garbage collector. To do that in the early 60s, you had to first invent garbage collection . Lisp was and is bril…

> `lambda` and function application alone are Turing-complete, as McCarthy would have known. The credit here belongs with Turing and Church, not McCarthy. `atom`, `cons`, `car` and all the rest are just icing on the cake of the lambda calculus when it comes to computability. This point reminds me of something interesting that I noticed recently despite having been familiar with basic LISP ideas for a long time. If yo…

> Also, recursion arises in a different form in lambda calculus than it does in the approach to computability that is based on general recursive functions. Again, I think that LISP is closer to Gödel here than to Church.

I think I understand most of the rest of your post, but I got lost here. Could you describe what difference you see here, and how it applies to LISP?

Re: The Idea of Lisp

#220
post #158

Earlier quoted context omitted.

But what makes Python any better at numerical algorithms than Common Lisp? It's not like CL is lacking in numeric support. It probably has superior numeric support than Python, actually.

Some/most Common Lisp implementation have better native support for numeric types than Python, but Python has a wealth of libraries like numpy that bind to optimised C/Fortran/assembly.

Exactly. Without numpy, Python is orders of magnitude slower at numeric computation than Common Lisp. With numpy, it's faster because numpy is basically C.
Post reply on HN