justinethier / husk-scheme

A full implementation of the Scheme programming language for the Haskell Platform.
http://justinethier.github.io/husk-scheme
MIT License
308 stars 29 forks source link

R7RS Support #24

Open justinethier opened 13 years ago

justinethier commented 13 years ago

See working group 1's draft:

http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/3027cfa1e8abf74b?pli=1

Progress report: http://developers.slashdot.org/story/11/10/04/1942209/R7RS-Scheme-Progress-Report

Latest draft: http://trac.sacrideo.us/wg/attachment/wiki/WikiStart/r7rs-draft-6.pdf

justinethier commented 13 years ago

According to the r7rs specification, the full list of changes up to this point is as follows. I will cross these out as support is added to husk:

The following are unlikely to be implemented:

joshtriplett commented 12 years ago

Of all of those, I'd really love to see the R7RS module system. That would help greatly with code structuring when using scheme as an extension language for a Haskell program.

justinethier commented 12 years ago

Thanks for the feedback. I had been holding off on this because WG1 has made changes to the module section since their first draft. But modules are the most important addition in R7RS and even a minimal, partial implementation would probably be useful in husk...

joshtriplett commented 12 years ago

If you think that the module API will change incompatibly before the final release of R7RS, then by all means feel free to wait until it becomes more stable. No rush.

justinethier commented 11 years ago

The plan is for the next release of husk to start having limited support for R7RS-style modules.

Going forward, R7RS items may be added as extensions if they are new "features" that do not break existing R5RS functionality. Any breaking changes will have to be included in a future "R7RS" mode, probably via command line arguments used to load a separate environment.

justinethier commented 11 years ago

Notes on how Gauche is implementing R7RS:

http://blog.practical-scheme.net/gauche/20130522-r7rs

jrmithdobbs commented 10 years ago

call-with-port would be a great addition.

justinethier commented 10 years ago

@jrmithdobbs - Thanks for the suggestion, this is a simple function to provide...

jrmithdobbs commented 10 years ago

Awesome. Also wondering why the srfi45 inspired changes aren't planned? It seems to me delay-force (srfi45's "lazy") should be fairly straightforward, easier, even, than most other implementations given the host metalanguage. :)

justinethier commented 10 years ago

@jrmithdobbs - Unfortunately, the way Husk is written makes it more difficult to implement SRFI 45 from spec. The problem is that set-car! and set-cdr! operate on Haskell lists instead of pointers. So you can't do some of the usual tricks with them that other Schemes support. Sorry :(

Nothing against SRFI 45. I would take a pull request for it, just have no plans to implement it anytime soon.

jrmithdobbs commented 10 years ago

Ah! Makes sense. Figured there was a reason. Why I asked. ;)

justinethier commented 10 years ago

Sure, no problem. I should be more clear about why it is on that list.

In any case this is an unfortunate restriction but there are ways to work around it.