22 comments

[ 3.2 ms ] story [ 65.8 ms ] thread
> PHP initially implemented its loops by fseek() in the source code.

real #wtf

ps: ltu discussion http://lambda-the-ultimate.org/node/4990

That looks like someone took the 'everything is a file' unix mantra a little bit too far.
hyper late bound lazy streamed os cached interpreter pattern
wait... how does that even work?

Read the current file's source from the start of a block and eval() the text n times or something?

That's just cheating.

Could fseek be considered more harmful than goto?
It's a real shame that Julia doesn't have a well defined syntax, especially given that the parser is written in the author's own non-standard lisp dialect.
(comment deleted)
Femtolisp is a very small, fast Scheme implementation – and Scheme is the most thoroughly standardized dialect of Lisp there is. The fact that Julia's parser is implemented in flisp also completely irrelevant to the user – you can for all purposes just consider it a C program that implements a custom parser for Julia. It's true that there isn't a formal grammar specification of Julia's grammar, but I'm not sure what that would be especially useful for.
It would be useful for implementing Julia parsers.
That's true but I'm not sure how many of those one wants until the language reaches a 1.0 version.
"...Scheme is the most thoroughly standardized dialect of Lisp there is"

More standardized that ANSI Common Lisp, hint it's in the name.

</facetious-reply>

But Femtolisp isn't Scheme, it's a non-standard Scheme with its own custom built-ins. It's quite impossible to run a Femtolisp program using a Scheme interpreter without modification.

Formal grammars are enormously useful, I almost always refer to them at some point when learning a language. It's an important part of being in an ecosystem larger than oneself. I'd question how a language without a well defined grammar has well defined semantics as the OP claims.

How many languages have you learned the syntax of by reading the source code of its parser? How about when the parser is implemented on a language you've never used?

Learning a programming language by looking at the formal grammar is like learning a spoken language just by reading a grammar textbook. No one actually does that. Learning a language by reading the parser is even more ridiculous. That's like learning a spoken language by dissecting the brain of a native speaker. The way people actually learn languages – both programming and natural – is by seeing examples, reading explanations, and by trying things out.
i have never gotten a good answer to why lush [http://lush.sourceforge.net/] failed to be a succesful goldilocks language in this space. the only real flaw i saw in it was the lack of lexical scoping; other than that it looked like a great solution to the same problems julia is addressing.
I love the history here. I know many CS programs offer a programming languages course, but I really think that should be mandatory.