News for hackers. Stuff that matters.
Re:Examining the Legendary Hurd Kernel (2008) by nickpsecurity on Tuesday July 14, 2015 @12:44PM (#9886230)
Your post is mostly accurate. Yet, the number of maintained implementations doesn't tell me anything about whether it's mainstream or worth using. Brainfuck language has a whole page worth of variants, implementations, uses, IDE's and so on. I doubt anyone will argue that we should use it for commercial projects. ;) A maintained, active implementation is only a start for a language.

For LISP, the market is small and fragmented. They've always had the problem of siloing off from each other while mostly not building enough standardized functionality to get momentum. The language also has lots of warts from the old days that it should eliminate (Clojure does a bit). They've mostly ignored all this and that's why the language doesn't go anywhere. That Python, inspired by LISP, lacks every one of these problems is probably a reason for its success.

Far as LISP's, I thought about relearning it and taking another go at it. Racket is the most interesting to me in terms of power, available libraries, community, and IDE. My old trick was doing imperative programming in LISP for rapid iteration and then auto-generating equivalent code to be handed off to a C or C++ compiler. Let me macro out the hacks needed for portability, performance, and security in many cases. Plus, interactive development + incremental function compilation is AWESOME.

Thinking on two lines this time. One is to redo my old approach with C and Go as the new targets. That lets me piggy-back on all their momentum with rapid prototyping and zero-to-low-overhead abstractions. Another is to reimplement Python & its standard lib in LISP in a way that integrates code in both. That should give a performance boost, a way into LISP for Python developers, and let me use Python code/libraries. Ton of work going into the latter.

Really busy so not sure if I can do either. What do you think about the options?

Re:Examining the Legendary Hurd Kernel (2008) by lispm on Tuesday July 14, 2015 @01:53PM (#9886743)
> Brainfuck language has a whole page worth of variants, implementations, uses, IDE's and so on. I doubt anyone will argue that we should use it for commercial projects.

Well, I fear Brainfuck does not have commercial vendors and users willing to spend money on that. Lisp has that.

> whether it's mainstream or worth using.

It's not mainstream, but there are people finding it worth using.

> That Python, inspired by LISP, lacks every one of these problems is probably a reason for its success.

Python is not at all inspired by 'LISP' and not even by Lisp.

> My old trick was doing imperative programming in LISP for rapid iteration and then auto-generating equivalent code to be handed off to a C or C++ compiler.

Common Lisp compilers do that C code generation for me. No need to write macros for that.

> Another is to reimplement Python & its standard lib in LISP in a way that integrates code in both.

That has been tried already. Doesn't interest Lisp developers much. For a Lisp user there is little benefit of using a mix of Python and Lisp. Either use Python without Lisp or use Lisp, especially since Lisp has the better implementations and allows a wide range of applications.

> What do you think about the options?

The Lisp to C options exists already in multiple forms (GCL, ECL, MKCL, mocl and a few in-house implementations). Another Lisp to C++ is under development: CLASP.

Python in Lisp also exists.

https://common-lisp.net/project/clpython/

Re:Examining the Legendary Hurd Kernel (2008) by nickpsecurity on Wednesday July 15, 2015 @10:51AM (#9891543)
"It's not mainstream, but there are people finding it worth using."

Remember where this discussion started. They're trying to get Hurd mainstream. A person made a suggestion on that. It uses something that failed to mainstream almost every time and is mostly hated by mainstream programmers. So, I suggested not to use it if the goal is making something very popular. In light of that, LISP can have as many tiny communities as it likes: won't help this use case.

"Python is not at all inspired by 'LISP' and not even by Lisp."

My bad. Misremembered: it was ABC.

"Common Lisp compilers do that C code generation for me. No need to write macros for that."

Compiling a functional program to efficient C isn't the same as writing inherently efficient C in a functional language. An amateur like me threw together one in a short time while the other took many PhD's worth of effort to get in good shape. Most of them still don't outperform my old system because they try to solve a harder problem.

"That has been tried already. Doesn't interest Lisp developers much. For a Lisp user there is little benefit of using a mix of Python and Lisp. Either use Python without Lisp or use Lisp, especially since Lisp has the better implementations and allows a wide range of applications."

Makes sense. Appreciate the review. :)

"The Lisp to C options exists already in multiple forms (GCL, ECL, MKCL, mocl and a few in-house implementations). Another Lisp to C++ is under development: CLASP."

"The Lisp to C options exists already in multiple forms"

I think you misread my comment. Your list are all LISP implementations with C or C++ support. My tech was a C/C++ implementation on LISP. A subset, more honestly, as I never needed the whole thing. I macro'd useful patterns to make it more like a BASIC-style 4GL. Those macro's had straightforward mapping to highly efficient C. The rest, much like BASIC, had straight-forward mapping. My style was imperative, the constructs were imperative, the target was imperative, and data types etc were all consistent. The result was a productivity boost over developing in C or C++ with interactive development, better debugging, less coding, automated checks at the flip of a switch, & automated generation of all the source & makefiles.

I haven't seen anyone post something similar in years. So, what do you think of that kind of tool as a compromise between highly efficient, portable C and the safer, higher-level languages that aren't efficient enough for eg operating systems? Is such a thing worth rebuilding until functional compilers are good enough to wholesale replace C/C++ in their niche areas?

"Python in Lisp also exists."

In one paragraph, you say it's pointless and nobody is interesting. Then you give me a link to an implementation in another. Puzzling you are. Thanks for the link, though. :)

Re:Examining the Legendary Hurd Kernel (2008) by lispm on Wednesday July 15, 2015 @04:36PM (#9893910)
> Compiling a functional program to efficient C isn't the same as writing inherently efficient C in a functional language. An amateur like me threw together one in a short time while the other took many PhD's worth of effort to get in good shape. Most of them still don't outperform my old system because they try to solve a harder problem.

Lisp is not necessarily 'functional'. It's also quite imperative.

There have been in the past Lisp compilers which generated 'readable' and 'maintainable' C from Lisp code. The compilers I mentioned didn't really have that goal.

> My tech was a C/C++ implementation on LISP. A subset, more honestly, as I never needed the whole thing. I macro'd useful patterns to make it more like a BASIC-style 4GL.

I remember reading about users writing C in Lisp, with added use of macros to make code generation easier.

> The result was a productivity boost over developing in C or C++ with interactive development, better debugging, less coding, automated checks at the flip of a switch, & automated generation of all the source & makefiles.

Sounds good.

> Is such a thing worth rebuilding until functional compilers are good enough to wholesale replace C/C++ in their niche areas?

Hard to say. I doubt that C/C++ users will use Lisp-based tools - unless its really really good and useful.

> In one paragraph, you say it's pointless and nobody is interesting. Then you give me a link to an implementation in another. Puzzling you are. Thanks for the link, though. :)

'Nobody' is maybe the wrong word. 'Almost nobody' is probably better. The Python in CL implementation exists for some years, but I haven't heard of larger adoption or much further development. It was developed at a time when Python integration seemed to be more important. But it's definitely a nice try and may have some interesting bits in it...