News for hackers. Stuff that matters.
Re:Carp: a statically typed lisp, without a GC, for high per... by akavel on Wednesday July 06, 2016 @04:04AM (#12041785)
I understand this is marked as "a research project", so any answer here is possible and must be accepted; that said I'd really love to learn at least about plans with respect to the following questions:

• Regarding FFI, is it possible to pass pointers to carp functions/closures as arguments to external dynamically loaded functions? are those features available in REPL?

• What's the story/approach regarding structs inheritance vs. composition? also custom types and implicit type casting?

• What are the plans regarding multithreading/parallelism? Esp. interesting with respect to memory handling.

At its current state of claims, the language sounds awesomely close to the "holy grail" for me at first glance — though with a fair bit of vagueness and uncertainty.

Re:Carp: a statically typed lisp, without a GC, for high per... by eriksvedang on Wednesday July 06, 2016 @04:53AM (#12041953)
1. Yes, and yes!

2. No plans for inheritance at the moment, probably some kind of interfaces but that's not a top priority right now. Custom types are limited to structs, I will add union types soon

3. This has not been decided yet, I want to do more research before settling on any particular solution. It will be a high priority though, since I want to use it for the games I write

Thanks, Erik

Re:Carp: a statically typed lisp, without a GC, for high per... by akavel on Wednesday July 06, 2016 @05:43AM (#12042086)
Thanks!

Re 1: are there any examples of this in the codebase? I haven't seen anything in the "examples/" subdir, did I overlook, or should I dive somewhere into the compiler/runtime codebase?

Also, some more questions still, if you wouldn't mind:

• Could you possibly answer junke's question? https://news.ycombinator.com/item?id=12041555 I didn't repeat it, as I hoped you'd see it too;

• Do you have tail-recursion? Also, to tell the truth, a list of "what we don't have yet" and also "what we don't plan to have" would help to confront my dreams with reality...

Regarding (2), personally I like Go's/Rust's approach, but I'm not an expert in the domain by any means, and I understand everybody has one's personal taste and view. Just couldn't resist, sorry :)

edit: Also I see you're the author of Else Heart.Break() - awesome, congrats!

Re:Carp: a statically typed lisp, without a GC, for high per... by eriksvedang on Wednesday July 06, 2016 @09:40AM (#12042971)
No tail recursion at the moment but it's something I'd be interested in adding later.

I'm being very conservative with adding different type constructs but sure, Rust & Go certainly gets a lot of things right in that department and I'll consider their solutions for the future development of Carp.

Re:Carp: a statically typed lisp, without a GC, for high per... by nickpsecurity on Wednesday July 06, 2016 @10:45AM (#12043380)
Neat to see a contender to replace what should've had plenty of adoption in this area:

https://en.wikipedia.org/wiki/PreScheme

I still don't see a clear answer to junkie's question despite a huge thread. Let's be specific: "Where no GC is used, how exactly do you handle the issue of memory safety? Is it no safety like C, a specific analysis like Rust, or something different entirely?"

Far as concurrency, you probably know about Rust's scheme. The ones that came before it that you might want to consider were Ada Ravenscar and Eiffel's SCOOP.

https://en.wikipedia.org/wiki/Ravenscar_profile

http://www.sigada.org/ada_letters/jun2004/ravenscar_article....

https://en.wikipedia.org/wiki/SCOOP_(software)

http://cme.ethz.ch/publications/

SCOOP might be the more interesting of the two for you. It was deployed in real-world apps in Eiffel first. Then, a team ported it to Java. It had a performance penalty. One of the many works in publications... don't remember which... did something ("slices?") that knocked out almost all that overhead. Another model-checked it to eliminate a few errors in SCOOP model. I see one on message-passing. So much badass work and results on SCOOP model I've been annoyed that it was ignored by mainstream for so long.

So, hope those help in your thinking on tackling concurrency. Personally glad I looked it up for you as I found this very, interesting project for safe use of GPU's:

http://se.inf.ethz.ch/people/poskitt/publications/Kolesniche...

Re:Carp: a statically typed lisp, without a GC, for high per... by eriksvedang on Wednesday July 06, 2016 @11:05AM (#12043525)
Thanks for the links!

The short answer is that safety is handled similar to Rust, using lifetime analysis. It's quite a bit more simplistic than Rust at the moment though. Also, some checks are done at runtime (like bounds checking on arrays, when turned on).

Re:Carp: a statically typed lisp, without a GC, for high per... by rurban on Wednesday July 06, 2016 @12:41PM (#12044246)
Using the information on dependent types and some inference and eliminate run-time type checks in those cases would be a nice type-checker job, e.g. for the sicp/solver.
Re:Carp: a statically typed lisp, without a GC, for high per... by nickpsecurity on Wednesday July 06, 2016 @02:11PM (#12044845)
Ok. There we go. It's actually what I had in mind for PreScheme. You just gave me more confidence in it.
Re:Carp: a statically typed lisp, without a GC, for high per... by Pxtl on Wednesday July 06, 2016 @08:01AM (#12042496)
Is the plan for this to be a stand-alone gaming language or a language for embedding into a gaming engine or framework like Lua? Obviously built-in threading constructs are less essential for the latter.
Re:Carp: a statically typed lisp, without a GC, for high per... by eriksvedang on Wednesday July 06, 2016 @11:05AM (#12043534)
Primarily stand-alone.
Re:Carp: a statically typed lisp, without a GC, for high per... by cbebdhhd on Wednesday July 06, 2016 @05:07AM (#12041999)
Could you pretty, pretty please allow for an option to have automatic parentheses insertion, similar to how javascript will insert semicolons, making them optional? This is almost exactly the language that I've been planning for the last six months, and if you would be so kind as to implement that one feature, it would save me a lot of reinventing the wheel.

I was originally envisioning having the compiler being able to infer parentheses based on code indentation.

Also have you considered compile time AST evaluation and simplification?

Re:Carp: a statically typed lisp, without a GC, for high per... by akavel on Wednesday July 06, 2016 @05:26AM (#12042045)
If it takes off, and fulfills all peoples' dreams and brings rainbow-farting pink ponies to Earth, then I suppose there might come lots of parser butchering by people and fitting it to their likes via forks/frontends - me, for example, I'd love it to look more Rebol-like ;)
Re:Carp: a statically typed lisp, without a GC, for high per... by larsbrinkhoff on Wednesday July 06, 2016 @07:44AM (#12042435)
Maybe you can use "Readable Lisp S-expressions".

http://readable.sourceforge.net/

Re:Carp: a statically typed lisp, without a GC, for high per... by imtringued on Wednesday July 06, 2016 @07:18AM (#12042356)
If you don't want the parenthesis then why not use reverse polish notation?
Re:Carp: a statically typed lisp, without a GC, for high per... by blastrat on Wednesday July 06, 2016 @08:46AM (#12042674)
unless you're thinking of something that I'm not thinking of? RPN only solves this when the operators are known and used exclusively in operator context and can be relied on as implied close-parens