
Potion: A Short Pamphlet - raju
http://hackety.org/potion/
======
saturdayplace
The output of this guy is simply staggering. I would love to know more about
him, and I'm sure he'd hate that. Like Bill Watterson.

~~~
iamwil
Part of the reason is that he keeps his projects limited in scope and simple.
If his github repo is any indication, he only works on one or two things at a
given time and is able to complete them (due to limited scope). Because he
doesn't take himself seriously, no one is harping on him to say that "we need
this or that, because we need it for ENTERPRISE!" So he's able to keep it
simple, get it done, move on, and learn something in the process.

As for how he supports himself and is able to make the time to code is a
mystery to me.

<http://github.com/why/potion/graphs/punch_card>

Looking at his commit patterns, it's throughout the days of the week, even
though the bulk of it is at night. But it's reassuring to see that even _why
stops for dinner, and the reason why the rest of us aren't as productive is
because we're not as consistently hacking away as he is.

As for knowing more about him, I'd say you'd probably learn more about him
reading his code than digging up things like his real name.

~~~
jobeirne
He never completed Hackety Hack.

~~~
misuba
That's "has not yet completed." There've been a couple new versions fairly
recently.

------
jimbokun
Interesting idea to silo off "s-expressions" into only the data part of the
language. He's stealing the idea of having a syntax for tree structures,
without going all the way into macro-land. The syntax for whitespace as method
invocation and the very sparse block syntax, however, gives a lot of
flexibility for DSL contstruction, though.

I also like that objects are not just tables, but some thought was give to
efficiency. I also see that Potion compiles into machine code, so I wonder to
what extent efficiency is driving the design compared to other "dynamic"
languages. Is the absence of anything more than integers just a sign of the
early stage of development, or does he want an efficient model for floats and
bignums and not willing to settle for just any old thing? It would be nice to
see another language shooting for that small, fast lower left corner of the
graph.

[http://gmarceau.qc.ca/blog/2009/05/speed-size-and-
dependabil...](http://gmarceau.qc.ca/blog/2009/05/speed-size-and-
dependability-of.html)

------
iamwil
"Even functions are functions! I invented this concept. Just like Steve Jobs
will one day."

~~~
andreyf
I don't get the joke. Is it a reference to Steve Jobs inventing UI concepts
which were developed at Xerox?

~~~
warwick
I think it's a reference to how Apple routinely claims things as new or
revolutionary during their keynotes, even when they've been available from
other manufacturers for some time.

~~~
benmathes
Furthermore, there's lore about the "reality distortion field" around Steve
Jobs. People would suggest ideas to him, he'd ridicule the ideas, and then a
week later suggest them as his own.

------
henning
"The Mersenne Twister (MT19937) © 1997-2002, Makoto Matsumoto and Takuji
Nishimura"

A new language including a high performance, reasonably high quality (suitable
for most Monte Carlo simulations) random number generator rather than the crap
that you get by default in most languages? Well I never.

~~~
nuclear_eclipse
Even PHP includes a good Mersenne Twister implementation (mt_rand() [1]) as
part of the core library...

[1] <http://www.php.net/manual/en/function.mt-rand.php>

~~~
blasdel
But why wouldn't they just use it to replace rand()?

~~~
nuclear_eclipse
Because mt_rand(), even when seeded with the same number, does not generate a
predictable sequence (ie, it's a really good MT implementation). For those who
_do_ want a predictable RNG based on seed value (regardless of whether you
agree with this usage), they can opt to use the libc implementation of rand()
and srand().

~~~
crux_
When you say "predictable", do you mean "repeatable?" Or do you really mean
"predictable?"

In the latter case, well, if you want predictable numbers you shouldn't be
calling a RNG at all. And in the former, it's not good, it's _broken_ , PRNGs
are supposed to produce the same sequence, given the same seed....

------
dublinclontarf
_why is like the Willy Wonka of the programming world. Absolutely genious, and
barking mad to boot.

I've been playing a little with Shoes, I love it.

------
jongraehl
I browsed around the source. I like that it's actually possible to get
something out of this activity.

There's some use of macros where inline functions (or even C++ templates)
would have been prettier. It's a shame C has such a lame macro language.

I was interested in how he claims space efficiency for objects, while still
leaving open the possibility of abusing an object (not its type; it's a
prototype based duck typed language) as a hash table via definition of new
methods. It seems that the object model does have vtable sharing between
instances of the same type, so I assume there's some kind of copy on write
when you add a method.

~~~
silentbicycle
While I haven't looked at the source, if it's anything like other prototype-
based languages, they would either share the same prototype ("vtable"),
literally adding the method to both at the same time, or it would be added as
an extension to only one of them. (Being able to add a method to just one
object OR all sharing a common prototype is a feature.)

Using prototypes, it would be one pointer. I don't see why that would be
particularly space-inefficient.

------
jasonkester
Cool. One tiny nitpick:

Periods as block terminators seems like a Classic Military Blunder to me. You
really want something that stands out for something that important, which is
why curly braces (and indentation (and "END IF")) work so well.

I have 3 dozen period-sized flecks of dust on my screen right this minute.
[pauses to wipe screen]. If this language went mainstream in its current
state, I predict lawsuits for squint-blindness.

~~~
silentbicycle
As I've noted elsewhere in the thread, Prolog and Erlang do this too. They
also use commas ( _and_ semicolons, in Erlang). OTOH, their syntaxes are
pretty straightforward, so it's not hard to have an auto-
indenting/highlighting editor make periods more noticeable.

I agree with you, but I think in practice it's less a problem than syntax bugs
caused by ambiguities in precedence, optional "else" clauses (shift-reduce
conflicts), etc.

------
shaunxcode
I think the use of , and or newline to separate statements is a stroke of
genius instead of just treating them as optional whitespace. Totally feels
like a more concise smalltalk if that makes sense.

~~~
stcredzero
The colon-period pairing to indicate a block is just as clever. That way, the
colon actually serves a _purpose_ instead of just being syntactic noise as it
is in Python. The ability to use tables as arguments also gives you the
advantages of keyword arguments in Smalltalk, but does it folded in with a
generic mechanism. As a result, the language is bigger than Smalltalk, but it
feels just as small.

~~~
msluyter
My eyesight isn't great and perhaps it just takes getting used to, but I found
periods rather hard to scan visually. Ay first glance I'd prefer something
else.

~~~
silentbicycle
A syntax-aware editor's highlighting or automatic indentation could provide an
extra clue, though. It can scan for periods quite easily.

Prolog and Erlang (which was initially implemented in Prolog) use periods to
end blocks, as well. While it can make rearranging expressions in a block a
little annoying ("," vs "." in Prolog, "," and ";" vs "." in Erlang), it's
small potatoes compared to the syntactic quirks in, say, C.

Also, Lua does the same "table as an argument -> keyword arguments" trick. (He
mentions Lua in the list of influences.)

------
biohacker42
_I hope this was only a brief interruption to an otherwise lush and exotic
life._

It's _why's work that makes my life more lush. Thanks you lucky stiff!

------
perezd
This language is pretty fascinating, I like its concepts quite a bit...maybe
someone needs to write Cauldron, Potion's agile web framework ? :P

~~~
randallsquared
First, someone will have to write Vial, Potion's DB interface or persistence
system.

------
trickjarrett
Some very interesting concepts in here, not sure where it would get used or
have an advantage. Is it purely a mental exercise?

~~~
pygy
Only partly so. He's exploring various ideas in language and VM desings, which
is interresting per se.

But one of the goal of the project is to get a fun, fast and dynamic language
to run on embedded processors.

It would allow one of the goals stated in the Little coder's predicament:
having an newbie-friendly environment that produces code runable on game
consoles (though you'd have to create suitable libraries too for that to
happen...).

Maybe I'm reading too much into it, but I think it will be added to Hackety
Hack sooner or later (if I remember well, he stated once that more languages
would be added. The first lick sample hints to that too).

------
r7000
I kind of like the distinction between single quotes and double. One allows
escape codes and the other doesn't (except for one - itself). Cool idea.

------
bluefish
Anyone use(ing) Potion for something other than just playing around with the
source?

~~~
technoweenie
No, it's still missing floats, mixins, reflection, etc. Not to mention
integration with existing libs like databases, xml parsing, etc.

~~~
silentbicycle
Which is too bad, because it really encumbers implementing something truly
novel. To be realistically useful, a tool needs to integrate with existing
tools and standards, but that's a lot of work.

"I estimate that 90-95% of the work in Plan 9 was directly or indirectly to
honor externally imposed standards." - Rob Pike, "Systems Software Research is
Irrelevant" (<http://www.cs.bell-labs.com/cm/cs/who/rob/utah2000.pdf>)

