[Haskell-cafe] ECMA262 (Javascript) interpreter

Fabian Bergmark fabian.bergmark at gmail.com
Sun Dec 7 06:35:10 UTC 2014


I based my work on HJS, but realized that it deviated to much from the
specification for me to patch it with the features I want.

Im aware of the test-262 test suit and have used it to do some casual
testing. Before I release my package to hackage I will make sure it
passes

2014-12-07 16:23 GMT+10:00 Andrey Chudnov <achudnov at gmail.com>:
> 1) Does it pass test-262?
> 2) I see you have implemented your own parser and AST? Have you looked at
> the other packages implementing/trying to implement that?
>
>
> On 12/07/2014 12:48 AM, Fabian Bergmark wrote:
>>
>> I have been implementing an ECMA-262 (Javascript) interpreter over the
>> last few weeks. I have been following
>> http://www.ecma-international.org/ecma-262/5.1 and tried to keep my
>> implementation as close to the specification as possible.
>>
>> The code can be found here https://github.com/fabianbergmark/ECMA-262
>>
>> So far I have implemented the core language, but has yet to write all
>> the specification functions (Array.splice, String.substring etc.).
>> Before I do this and release it on hackage, I would appreciate
>> feedback on my implementation.
>>
>> The issues I see at the time are:
>>
>> * The parser is slow for deeply nested code
>> * Strict mode is not implemented
>> * Interpret.hs is ~ 6k lines
>> * SubType.hs uses IncoherentInstances, and a better implementation
>> would be nice. At the moment it works but for one case.
>>
>> To test the code, install the cabal package and run ecma262 on a .js
>> file. One host object, console.log is provided and prints to stdout.
>>
>> Fabian Bergmark
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>


More information about the Haskell-Cafe mailing list