News for hackers. Stuff that matters.
Re:Shift.js: Swift to JavaScript Transpiler by SneakerXZ on Friday November 06, 2015 @08:24PM (#10523167)
It is a cool idea but I don't understand why you don't write your compiler in Swift so at some point you can compile your compiler with your own compiler.

Unfortunately, it is far from usable. It is unable to parse even basic Swift code.

Re:Shift.js: Swift to JavaScript Transpiler by dchurchill on Friday November 06, 2015 @08:46PM (#10523257)
Thanks. The project is still in active early development, so there are still a lot of bugs that need to be worked out. We have a good portion of the core language features covered so far, and are working on adding more.
Re:Shift.js: Swift to JavaScript Transpiler by mikeash on Friday November 06, 2015 @11:06PM (#10523647)
It looks like you're using built-in collection types in the resulting JavaScript without accounting for the fact that Swift collections are value types, not reference types. Do you plan to address this? There's another third-party Swift implementation out there focusing on Android which does the same thing and buries this drastic language change in the fine print, which is rather unfortunate.
Re:Shift.js: Swift to JavaScript Transpiler by Dnld on Friday November 06, 2015 @11:32PM (#10523719)
This is on the radar. The differences between the languages, especially regarding collections, are tricky. For example we're finalizing a data structure to mimic tuples that would allow value lookup by index and/or element name.
Re:Shift.js: Swift to JavaScript Transpiler by mikeash on Friday November 06, 2015 @11:34PM (#10523726)
Great! It must be pretty tricky to translate that across without destroying performance and interoperability. I just wanted to check, because the other one seemed to think it was no big deal to leave it this way.
Re:Shift.js: Swift to JavaScript Transpiler by chrisseaton on Saturday November 07, 2015 @08:39AM (#10524744)
> I don't understand why you don't write your compiler in Swift so at some point you can compile your compiler with your own compiler

Is there a solid technical or user requirement for that to be done? If there isn't, why do it?

Re:Shift.js: Swift to JavaScript Transpiler by TazeTSchnitzel on Saturday November 07, 2015 @09:22PM (#10527130)
Well, getting a compiler to be self-hosting means it has to be good enough to compile a large, complex, real-world application: itself.