soegaard / whalesong

Whalesong: Racket to JavaScript compiler
http://hashcollision.org/whalesong
145 stars 14 forks source link

Version Compatibility in Readme #50

Closed ZelphirKaltstahl closed 7 years ago

ZelphirKaltstahl commented 7 years ago

Today I decided I want to try out Whalesong. First I tried installing as shown on the documentation page, but that only caused many errors and failed. Then I searched GitHub for issues regarding those errors, finally finding a link to this repository. Then I read the note in the Readme file telling me it depended on Racket 6.2:

Important

Whalesong needs Racket 6.2. As is Whalesong doesn't work on version 6.3 or greater. See https://github.com/soegaard/whalesong/issues/48

So I thought "Ah too bad, I'd have really liked to try it.", but then I read something contradictory in the same readme:

This fork of Whalesong differs from dyoo/whalesong in the following ways:

  • Builds on latest release of Racket (fixes the x undefined problem)

So which one is it? 6.2 or the latest version? Or does this only mean, that the library was created using Racket 6.8, but to use it you need to use 6.2?

I think this could be made a bit clearer in the readme.

I don't really know what differences in language and performance there are from Racket 6.2 to 6.8. Considering the timespan Racket is version 6.8 and the frequency of people working on it, I'd guess the differences in performance could be quite big, while I'd guess the language for the user was probably already quite stable. Depending on an older version "so many versions ago" makes me feel unsure about using Whalesong. Maybe I'll want to have other libraries for a project, but then I am stuck with Racket 6.2 and cannot use those other libraries. Such and similar issues come to mind, which is why it is really important to clarify what exactly the situation with the version dependency is.

soegaard commented 7 years ago

Hi.

Thanks for notifying me about this. It's version 6.2 (which at the time the readme was written was the latest version). Sadly WhaleSong doesn't work on the current version anymore.

I'll fix the readme.

/Jens Axel

soegaard commented 7 years ago

Fixed. Thanks again.

soegaard commented 7 years ago

@ZelphirKaltstahl With respect to your question about options. See this recent discussion on the Racket mailing list: https://groups.google.com/d/msg/racket-users/yZ8CH3Sr2qs/Hh0Q7JJWBQAJ

ZelphirKaltstahl commented 7 years ago

@soegaard Thanks! I'll take a look. Risking not really understanding the answer: What is it, that makes Whalesong not work with Racket 6.8?

soegaard commented 7 years ago

@ZelphirKaltstahl

There are two issues.

  1. New bytecodes (small problem - maybe)
  2. A new macro expander (big problem - maybe)

WhaleSong works like this:

  1. The program is macro expanded using Racket's expander
  2. The program is compiled to bytecode by Racket's compiler
  3. The bytecodes are compiled to JavaScript by Whalesong's compiler

Each time a new bytecode (or new fields are added to existing bytecodes) the Whalesong compiler needs updating. (You can find a patch for Whalesong for version 6.3 in one of the issues that simply ignores newly added fields). Depending on the changes this can be either trivial or advanced to implement (most changes are small).

However the internals of the Racket macro expander changed dramatically since 6.2. How this exactly affects WhaleSong I am sure. The time line is that new bytecodes were added to the virtual machine (breaking Whalesong) then the macro expander was updated. This means that I haven't been able to run a version of Whalesong on a version of Racket with the new expander.

Note that Whalesong has it's own "virtual machine" so don't expect to see any big differences in performance between a Whalesong running in version 6.2 versus one on 6.8.