<kaplan__>
Essentially, an open source implementation of swift
<kaplan__>
eligrey, ^
<eligrey>
yeah i haven't used swift ever
<kaplan__>
I love it
<kaplan__>
First language after python I thoroughly enjoyed
<kaplan__>
too bad it is proprietary
<eligrey>
there's probably already an open parser grammar for swift
<eligrey>
or at least a closed source refernce one that ships with swift
<eligrey>
by grammar i mean ebnf
<eligrey>
or abnf or whatever it is we're supposed to use
<kaplan__>
eligrey, so, say we had a language already and wanted to build a compiler for it
<kaplan__>
Is it possible without the language spec?
<eligrey>
yeah you can always reverse engineer your own abnf
<eligrey>
based off the english language spec that apple probably provides
<eligrey>
but knowing apple you probably can't get the english documentation or spec without signing an nda
<eligrey>
and paying a fee
<kaplan__>
eligrey, so, what is the minimum I need to know to implement a language?
<kaplan__>
I am a beginner in programming
<eligrey>
then making your own language might not be a good idea
<eligrey>
just make something in an already existing language
<eligrey>
if you want to implement swift at minimum you need to know llvm internals, c++, objective c, and how to reverse engineer an abnf of the language based off public non-nda'd masterials
<kaplan__>
eligrey, no, I mean where to start reading up on this stuff
<ELLIOTTCABLE>
kaplan__: hi.
<kaplan__>
ELLIOTTCABLE, Where did you learn all this compiler stuff
<ELLIOTTCABLE>
k I disagree with Eli on several specifics
<ELLIOTTCABLE>
but agree with him overall, I think
<ELLIOTTCABLE>
first off:
<ELLIOTTCABLE>
there's two discussions here.
<ELLIOTTCABLE>
“what knowledge do I need, as a relatively beginner developer, to build a language a little bit like Swift,”
<ELLIOTTCABLE>
and,
<ELLIOTTCABLE>
“what do we need to build an ABI-compatible Swift-equivalent compiler, without Apple's blessing.”
<kaplan__>
More interested in the first
<ELLIOTTCABLE>
The latter basically falls under ‘not gonna happen.’ It *is* possible, but you need a lot of time, and a lot of very highly skilled people.
<ELLIOTTCABLE>
I'd suspect that's something that's only going to happen if a company picks up your project and sponsors it. Money == productive PLT projects. :P
<ELLIOTTCABLE>
okay.
<ELLIOTTCABLE>
at a high level, here's how I'd suggest you go about that:
<ELLIOTTCABLE>
(I'm time limited, this will be brief.)
<ELLIOTTCABLE>
1. go through *all* of the Swift documentation (or perhaps even print it out and take a hilighter to it), and note/copy-paste all the basic features you couldn't live without. the bare essentials to build a vaguely Swift-like language on top of the Objective-C runtime.
<ELLIOTTCABLE>
Then go through the beginner language-development / compiler-development resources, working on a simplistic language along those lines.
<ELLIOTTCABLE>
2. Once you know your stuff a little bit better (don't have to be a world-shattering expert or anything, just have some of the problems phrased in your head well), start building a compiler for Phoenix, in your stripped-down simple language
<ELLIOTTCABLE>
finally, much later, 3. start building the self-hosting Phoenix compiler using your Phoenix.
<ELLIOTTCABLE>
this approach has these benefits:
<ELLIOTTCABLE>
- You'll be able to throw out entirely any feature or ignore any problem that's truly eating up your time and effort, during 1.; the purpose is to learn, and strategize, more than anything else
<ELLIOTTCABLE>
- You'll learn a lot not only how to build a programming language and a compiler, but *also* learn *specifically what the compiler for a language like Swift is going to require*, in intimate detail, during 1.
<ELLIOTTCABLE>
(this will allow you to more usefully strategize during the design of the actual Phoenix language.)
<ELLIOTTCABLE>
- this gets you working on your dream-project immediately, despite your lack of current skill; that's crucial for keeping your spirits up over the loooooong haul that is a PLT project,
<ELLIOTTCABLE>
- during 2., you'll spend all of your time working *in a language*, albeit sparse, similar to the one you're targeting. this is good; it gives you a good feel for your users' eventual problems.
<ELLIOTTCABLE>
- throughout the design-process for Phoenix (2. and 3.), you'll be working in a programming environment you (or hopefully, you and your colleagues, at that point) designed entirely; every programmer knows that a customized programming environment is a huge productivity boost; and there's none larger than having created the language yourself
<ELLIOTTCABLE>
and finally,
<ELLIOTTCABLE>
- self-hosting compilers are necessary for any serious compiled PLT project. and this plan will eventually get you there.
<ELLIOTTCABLE>
as for resources:
<ELLIOTTCABLE>
Dragon book, is something.
<ELLIOTTCABLE>
But I'd simply pick up the R5RS spec, and try to learn / build my own Scheme/Lisp, first. It'll be easier than you probably imagine.
<ELLIOTTCABLE>
there's also excellent resources / tutorials for that, around. there's no better starting point, IMHO.
<ELLIOTTCABLE>
keep it simple at first. no need to write 100% of a Lisp, 90% is enough to learn what you need to before you begin to design your MiniPhoenix language.
<ELLIOTTCABLE>
k, bbl, I spent too long talking about all this D:
<kaplan__>
ok
<kaplan__>
ELLIOTTCABLE, thanks again
alexgordon has joined #elliottcable
manveru has quit [Read error: Connection reset by peer]