Live data from Hacker News

LispY C

github.com

21–30 of 45 posts

Re: LispY C

#21
post #19

Earlier quoted context omitted.

Talking about speed, someone put this online http://www.nexoid.at/tmp/scheme-benchmark-r7rs.html

Chez Scheme (the compiled version vs. Petite Chez) figures high on those lists, and it was just opensourced by Cisco. I used to use Gambit-C, and I still like it, but Chez is fast.

It is and regularly way above the others. I had to hold on my fanaticism.

Re: LispY C

#22
post #20

Clasp is not quite the same, but it can work seamlessly, and compiles to machine code using an LLVM backend [1]. It was created to facilitate using all of the scientific libs in C++ by a chemistry professor for the creation of molecules [2]. It's a big codebase. I'll have to look at LispY C, since on first impression it seems smaller, and I like C! [1] https://github.com/drmeister/clasp [2] https://github.com/drmeist…

Clasp is an implementation of Common Lisp, a standard language and not a self-designed lisp as in the case of Lisp/C.

Re: LispY C

#23
post #8

I feel like besides powerful macro generation, the other big selling point of a lisp is that you can dynamically generate code at runtime, either by providing hooks into the compiler itself or by running the generated code through an interpreter. This project doesn't seem to do that at all. Does anyone know of any similar projects that do?

I never published it, but I wrote FFI bindings from common-lisp to the tinycc library, and it could generate and compile C code at runtime without having to shell out to a C compiler. It was really more of a toy than anything else, though it was slightly useful for things like basic system calls with complicated structs.

Re: LispY C

#24
post #10
post #7

> Because LISP is expressive and C is fast and I wanted the best of both worlds is the short answer. I'm not sure how well known it is, but some Lisps can be statically compiled to machine code. But one thing I've wondered about is how good can it get? Are there any benchmarks for Lisp vs. C?

For example: https://www.call-cc.org/ That's a full Scheme that compiles to C. It's quite nice, too!

It's a fine compiler for sure, but have you seen the generated C output? It's based on Henry Baker's Cheney-on-the-MTA compilation strategy.

https://wiki.call-cc.org/chicken-compilation-process

Re: LispY C

#25

Why replace "struct" with "class"? These are completely different things. >.>

I don't see where you get that. There is a struct function. That said, the only difference between a struct and a class is that struct member defaults to public, and class members default to private.

> the only difference between a struct and a class

In C++ land, this would be true.

C doesn't let you write methods within structs. C structs don't even have inheritance. No virtual table is generated. There is no single-dispatch mechanism.

Re: LispY C

#26
post #20

Clasp is not quite the same, but it can work seamlessly, and compiles to machine code using an LLVM backend [1]. It was created to facilitate using all of the scientific libs in C++ by a chemistry professor for the creation of molecules [2]. It's a big codebase. I'll have to look at LispY C, since on first impression it seems smaller, and I like C! [1] https://github.com/drmeister/clasp [2] https://github.com/drmeist…

Clasp is an implementation of Common Lisp, a standard language and not a self-designed lisp as in the case of Lisp/C.

Thanks for the clarification. I am going to dig in and have a look.

Re: LispY C

#27
post #19

Earlier quoted context omitted.

Chez Scheme (the compiled version vs. Petite Chez) figures high on those lists, and it was just opensourced by Cisco. I used to use Gambit-C, and I still like it, but Chez is fast.

It is and regularly way above the others. I had to hold on my fanaticism.

I am playing with Eduardo Cavazos's libraries with Chez [1], and particularly the port of xspringies. Great fun considering as he points out that the mass-spring calcs are all taking place in scheme. It runs fine on my 2-3 year old notebook.

C was a third language for me in the day, and I like Lisps, so this Lispy-C thing is going to eat my afternoon up!

[1] https://github.com/dharmatech?tab=repositories

Re: LispY C

#29
post #4
post #2

So crazy it might just work.

I'd be surprised if something exactly like this but more mature and with a lot more questionable legacy design decisions doesn't already exist.

There is the GSL by iMatix https://github.com/imatix/gsl (so closely associated with Pieter Hintjens of http://zeromq.org/)

Re: LispY C

#30
I don't quite understand, is this a tool to generate C code, or you can use compiled result directly from CL?
Post reply on HN