Friday, July 11, 2008

Back, and hopefully better

So, this blog has been abandoned for about a year and a half. About 3 weeks after I started it, a college friend IMed me and asked if I wanted to start a startup with him. Naturally, I did, so that ate up all my time for a year and a half.

But now the startup has folded, and I want to come back to this, just as a hobby. While I was doing the startup, I used to joke that if I succeeded and ended up rich, I'd probably end up doing exactly the same thing, just working on more interesting and less useful projects. Here's my highly interesting but probably useless project. ;-)

In accordance with the reduced scope of this project (or maybe not; it was always just a hobby project), there's a new goal:

Eve is intended to be a practical purely-functional programming language, suitable for the types of scripting and web tasks that people currently use Python or Ruby for.

In particular, there will be no basic research in Eve, no fundamental questions about the nature of type systems or concurrency. After being burned by being too ambitious with the startup, I think I'll leave that to the tenured professors and grad students. Instead, it'll be a distillation of the experience that the Haskell, Erlang, and Python communities have already earned. Much of the interesting stuff will come from taking things that are very obvious to us now - user sessions and identity in a webapp, for example - and seeing how they work out in a stateless environment.

The project has moved to GitHub, as git is IMHO more useful than svn for an open-source project. It's still really in prerelease: there's no documentation, and it's not really useful enough for real programming yet. Here's what it does have:
  • Indentation-sensitive syntax similar to Python. The linebreak rules are like Ruby's though: the parser lets you break lines before or after an operator, where a syntax error would otherwise result.
  • Integer, boolean, string, and symbol primitives, along with most of the expected functions on them (arithmetic, comparison, concatenation, indexing, type coercion)
  • Tuple types, with a common sequence abstraction for tuples, strings, and user-defined types.
  • Records. Like Arc and CLOS, Eve treats field access as equivalent to a function call; thus foo(a_record) can mean either "call the function in binding 'foo' with argument a_record" or "give me the 'foo' field of a_record". The former takes precedence. There is a special left-associative infix operator -> for function application, so the former could've been written "a_record -> foo". Similarly, calling the Str method on 2 may be written as "2 -> Str".
  • Lambda expressions. I use a Rubyish/Smalltalkish syntax of {| arg1, arg2| arg1 + arg2 }. Lambdas are full closures.
  • Partial application. Basically, any compound literal or function call may be partially applied by replacing an expression with ?. This results in the call being replaced by a lambda, with ? expressions as parameters. Partial application extends only to the nearest enclosing expression, eg. "2 + ? * 3" parses as "2 + {| x | x + 3}", which gives a type error, instead of "{|x| 2 + x * 3}".
  • Defs, both within files and within other defs (closures). Defs can refer to each other, i.e. they translate to a letrec and not a nest of lambdas. The module system is the same as before
  • Multimethods. If a method raises a type error, the interpreter keeps trying all other bindings for that symbol. Multiple definitions create multiple bindings. (I'm not quite satisfied with this system, since it tends to result in accidental method definition. But it's good enough for now).
  • Optional type definitions and type declarations. Type declarations currently just become runtime assertions, like in soft-typing, though eventually I want to use them for real typechecking.

My hope is to get things bootstrapped before I get a real job (I'm looking for positions out in Silicon Valley...anyone want an engineer with an interest in programming languages, JavaScript, and webapps?), then continue this as a hobby. Likely will compile to LLVM, at least at first, with the compiler being a library written in Eve. Then we can adjust from there.

5 comments:

Slava Pestov said...

Good luck.

John said...

Hi,

I work for an early stage startup here in the valley. We will be hiring more engineers soon and we are always on the lookout for bright people that have a genuine interest in software development, as you certainly seem to.

If you're interested, send me your resume at john at jpevans.com and I will be happy to tell you a little more about us, and see if you might be a good fit, etc.

Thanks.

Curtis said...

Any examples? Lists of features are informative and all, but they don't really help you get a "feel" for the language.

Jonathan Tang said...

@slava: Thanks.

@john: Coming up.

@curtis: There's some examples in the source tree, eg. the beginnings of a standard library and lots of tests. Eve is pretty young and immature, so these aren't all that extensive and probably will change, but you can get a sense of the general flavor from them.

heisenbug said...
This post has been removed by the author.