8 posts tagged “geekery”
ZOMG. I just found this paper written by David Teller in 2004. It's freaking awesome.
| Abstract | |
| Although limits of resources such as memory or disk usage are one of the key problems of many communicating applications, most process algebras fail to take this aspect of mobile and concurrent systems into account. In order to study this problem, we introduce the Controlled π-calculus, an extension of the π-calculus with a notion of recovery of unused resources with an explicit (parametrized) garbage-collection and dead-process elimination. We discuss the definition of garbage-collection and dead-process elimination for concurrent, communicating applications, and provide a type-based technique for statically proving resource bounds. Selected examples are presented and show the potential of the Controlled π-calculus. |
Hee!
The Koan of Static Type Safety
A disciple of another sect invited Markus Mottl to the beach. As he is driving his car along, he tells Markus: "Dynamic Typing makes me more productive! I can write my program faster if I do not have to worry about the compiler complaining about types". Since it is a long trip, the disciple of Dynamic Typing decides to make a stop for petrol. He enters the station to pay for the fuel and purchase a slurpee, while Markus attends to the refueling. Markus notes that the petrol pump is in use, so he starts pumping diesel fuel into the disciple's car. The disciple cries out, "Hey! What are you doing, this is a petrol car!". Markus replies, "Well, I wanted to get to the beach faster".
When your language allows the programmer to specify the precedence of operators, you're going to have a hard time parsing it with a grammar accepted by Yacc. That's because Yacc produces LALR(1) parsers, and that isn't going to work for you. Fortunately, for my current project, I have a really nice module of parsing combinators in my OCaml NAE Core Foundation that can produce LL(x) parsers. What's so nice about it? I can still use a static lexer with it, and I've got a nice lexical analyzer already. (It supports layout boxes like the ones planned for Haskell', which is the first reasonable model for whitespace sensitive syntax I've ever seen.)
Oh, now that is rude.
Thanks to Didier Rémy and Benoît Montagu, I now have a solution to my type system problem.
I've been distracted lately while other things have been happening, and I haven't had much time to comment on them. Here's a bit of catching up...
- Suitable for embedded systems development. "Can I write a microkernel with it?"
- Accurate garbage collection of the dynamic store is available, but optional.
- Safe pointers, à la Cyclone.
- A Hindley-Milner type inference engine.
- Language front-end knows all the semantics, so error messages are sensible, i.e. no text preprocessor.
- Some additional hackery to make interfaces with build systems not have to suck so much. (More on that later.)
- Built-ins for concurrency, à la JoCaml or Concurrent Haskell. (Cyclone fails here.)
- Syntax that doesn't make me want to claw my eyes out while I'm reading my own code. (Cyclone fails badly here.)
(#--- This is a test ---#)
static w a := 64 / a
static g := 32packet v a b := a array[w b]
packet b := word 8
packet p z i := b sign -zvma z array[i] sign -o
packet r := v [form [k :: word g, n :: b array[w 128]]] 2##| STATIC EXPRESSION TYPE ERROR
static k := w ()##|-- End of file
test.pi0:2:15-20: error: static binary operator '/' types mismatch...
static w a := 64 / a
^^^^^^
test.pi0:11:13-16: ...evaluated here:
static k := w ()
^^^^
Reading about the discovery of memristors in EE Times today brings back fuzzy memories of my undergraduate classes in electronics engineering.
[...]
"Electronic theorists have been using the wrong pair of variables all these years--voltage and charge. The missing part of electronic theory was that the fundamental pair of variables is flux and charge," said Chua. "The situation is analogous to what is called "Aristotle's Law of Motion, which was wrong, because he said that force must be proportional to velocity. That misled people for 2000 years until Newton came along and pointed out that Aristotle was using the wrong variables. Newton said that force is proportional to acceleration--the change in velocity. This is exactly the situation with electronic circuit theory today. All electronic textbooks have been teaching using the wrong variables--voltage and charge--explaining away inaccuracies as anomalies. What they should have been teaching is the relationship between changes in voltage, or flux, and charge."
I'm vastly amused by this.
When businesses want to communicate with their customers via e-mail, many send messages with a bogus return address, e.g. "somethinghere@donotreply.com." The practice is meant to communicate to recipients that any replies will go unread.
But when those messages are sent to an inactive e-mail address or the recipient ignores the instruction and replies anyway, the missives don't just disappear into the digital ether.
Instead, they land in Chet Faliszek's e-mail box.
