Live data from Hacker News

Lisp-stick on a Python

docs.hylang.org

101–110 of 170 posts

Re: Lisp-stick on a Python

#101
post #55
post #52

I've been hearing claims my entire programming career about how Lisp is supposedly "superior" to mainstream programming languages, but I've never seen a concise code example that actually demonstrates this. For instance, it's easy to demonstrate how Rust is superior to C: Just show a short piece of code where an array is returned from a function. In C, this will involve raw pointers and manual memory management with…

I genuinely like Rust, but it's pretty amazing that you managed to write a comment on this article and make it about Rust. Peak HN :-) Re Lisp's superiority - Lisp was certainly a superior language when it was devised many decades ago, but over time much of its comparative advantage has been absorbed by other languages. Starting in the 90s when productive, GC'd scripting languages like Python started being prominent…

Is someone willing to go back in time and let comp.lang.lisp know about Rust?

Re: Lisp-stick on a Python

#102

Earlier quoted context omitted.

This a trick question because 10 line programs are trivial. Please show me a high performance hardware-accelerated 3D game engine written in lisp. Or a web browser.

> Or a web browser https://nyxt.atlas.engineer/

this uses a C++ rendering engine

Re: Lisp-stick on a Python

#103

Earlier quoted context omitted.

> Or a web browser https://nyxt.atlas.engineer/

this uses a C++ rendering engine

so what ? the parent asked for a web browser. nyxt is rendering-engine agnostic by design

otoh how much rust is there in firefox? a:

https://4e6.github.io/firefox-lang-stats/

Re: Lisp-stick on a Python

#104
post #60

Earlier quoted context omitted.

I can, without restarting my program: 1. Gather assembly level profiling information 2. Redefine & recompile a function 3. Gather new assembly level profiling I can iterate dozens of times between #2 and #3 in the time of a single incremental production build in rust (debug builds are not useful for gathering profiling data). Generally speaking it takes less than a second to recompile and load a source file, and it c…

Doesn’t VS do that too though? Also if you’re talking about performance or memory profiling, why are you using a Lisp in the first place?

Yeah, those are nice features for development, but for actual running code those are anti features usually.

Re: Lisp-stick on a Python

#105

What am I looking at here? And what is it for?

This might be a better starting point:

https://docs.hylang.org/en/stable/whyhy.html

Shortened from there:

Hy (or “Hylang”) is a multi-paradigm general-purpose programming language in the Lisp family. It’s implemented as a kind of alternative syntax for Python. Hy provides direct access to Python’s built-ins and third-party Python libraries, while allowing you to freely mix imperative, functional, and object-oriented styles of programming.

Re: Lisp-stick on a Python

#106
post #60

Earlier quoted context omitted.

I can, without restarting my program: 1. Gather assembly level profiling information 2. Redefine & recompile a function 3. Gather new assembly level profiling I can iterate dozens of times between #2 and #3 in the time of a single incremental production build in rust (debug builds are not useful for gathering profiling data). Generally speaking it takes less than a second to recompile and load a source file, and it c…

> Redefine & recompile a function not just functions, but whole classes too

Does this include replacing all existing instances of this class with new instances? Otherwise, how is this different from what we can do in any other dynamic language like python or javascript?

Re: Lisp-stick on a Python

#107
post #67

Earlier quoted context omitted.

I mean the famous example is of course, (define (eval exp env) (cond ((number? exp) exp) ((string? exp) exp) ((symbol? exp) (lookup exp env) ((eq? (car exp) 'quote) (cadr exp)) ((eq? (car exp) 'lambda) (list 'closure (cdr exp) env)) ((eq? (car exp) 'cond) (eval-cond (cdr exp)) (else (apply (eval (car exp) env) (eval-list (cdr exp) env))))) which uses a Lisp to define itself. This means roughly that if you understand…

> This means roughly that if you understand enough Lisp to understand this program Any recommendations on good resources for learning Lisp to a degree that this program is understandable?

Watch Will Byrd's MiniKanren Uncourse. The topic sounds off, but he takes a few videos to get there, making a Lisp on the way, explaining this, or a variant of it. Should be within the first 4 videos.

Re: Lisp-stick on a Python

#108

Lisp examples always use addition, but this is what trips me up (- 2 3) And (- 4 3 2)

It's a little awkward because most languages read and write the wrong way around, but you can read it as "substract from 4 the numbers 3 and 2".

Re: Lisp-stick on a Python

#109

Earlier quoted context omitted.

> Redefine & recompile a function not just functions, but whole classes too

Does this include replacing all existing instances of this class with new instances? Otherwise, how is this different from what we can do in any other dynamic language like python or javascript?

all instances of the class are updated, which is more powerful than replacing. if you are curious to try it you can refer to the following

https://lispcookbook.github.io/cl-cookbook/clos.html#:~:text....

Re: Lisp-stick on a Python

#110

Earlier quoted context omitted.

> Redefine & recompile a function not just functions, but whole classes too

Does this include replacing all existing instances of this class with new instances? Otherwise, how is this different from what we can do in any other dynamic language like python or javascript?

Yes, and there is even an API to control the update process of the existing instances.
Post reply on HN