7 ms·
Potion - a little fast OO language by _why
- vorador 18y agowho is _why ?
- khafra 18y agohttp://poignantguide.net/ http://poignantguide.net/ http://en.wikipedia.org/wiki/Why_the_lucky_stiff http://en.wikipedia.org/wiki/Why_the_lucky_stiff A developer and Ruby advocate who's written one of the earlier and more popular guides. ...you don't know how much restraint it took to avoid the Abbot and Costello routine there.
- utnick 18y agohttp://hackety.org/ http://hackety.org/, creator of a ruby gui toolkit and a bunch of comic book tutorials about ruby.
- deleted 18y ago[deleted]
- bprater 18y agoWhat do you guys think of the language?
- arockwell 18y agoThe first feature that really jumped out at me were the scoped mixins. From the docs: You can swap out mixins for the span of a single source file. Example: you could give all strings a "backwards" method. But just for the code inside your test.pn script. This would let you monkey patch in a safer fashion.
- wingo 18y agoReminds me of Pascal Constanza's context-oriented programming stuff.
- omouse 18y agoA better way of handling this is package-based rather than file-based.
- arockwell 18y agoI think you can perform the scoping in a very fine-grained fashion, because the docs also say: You can re-mix for the span of a single closure. I wish there was an example in the docs I could post of this in action, because I'm curious about how this works.
- huhtenberg 18y ago> I don't like significant whitespace, personally ... (one of ideas is an) elimination of line noise* Yay to that. If you think about it, very few programming languages had legibility (readability) of the code as one of their design goals. Not through the natural language verbosity, but rather by reducing or eliminating the code needed to please the compiler and otherwise not related to the actual application logic. D makes a good step forward in this direction (compared to C++), and so does Python. Java is close, but still pretty "noisy". Petrovich is the best there is, but it's not very practical. This is an interesting subject, so if anyone has any thoughts on the matter, please post below.
- jonnytran 18y ago"Java is close"?! Are you kidding? I think at the end of the day, what is noise for one application domain is signal for another. Have you heard of Concept programming? http://mozart-dev.sourceforge.net/cp.html http://mozart-dev.sourceforge.net/cp.html I think the basic idea is that it somehow separates the domain-specific code from the code that pleases the compiler.
- narag 18y agoNot only Java is noisy, but its libraries and frameworks are so WET (Writing Excesive Times) it's deafenng.
- russell 18y agoPython was designed with readability as a goal. That was the reason for significant white space rather than {}. On some European keyboards the braces had to be typed as triples. I don't find Java particularly readable even though I code in it every day. a.equals(b) vs a == b The antithesis of readability is APL, which is nothing but line noise. When it came out, you had to get a special printhead just to type it. You could make some unbelievable one-liners though.
- iamwil 18y agoIt's interesting that there are no classes, and that there are only Objects, where you just mix everything in. As I understand it, javascript objects are like this, except you only add in methods one at a time, instead of mixing in and out modules. It doesn't look like there are inheritance trees. I'm not sure what you'd do to prevent namespace clashes when mixing in different modules or if/how modules share and work on object attribute data, but so far in Ruby, that hasn't been too much of a problem.
- richcollins 18y agoSee http://iolanguage.com/ http://iolanguage.com/
- nihilocrat 18y agoI think you'll have a "well, duh" reaction if you implement an OO system in pure C. It is basically just a bunch of structs (data) with a bunch of functions which take a struct pointer as their first argument. Mixins just let you randomly add or remove these functions without any extra shenanigans, which you can also easily do in our pure C OO system.
- davidmathers 18y ago"I'm not sure what you'd do to prevent namespace clashes when mixing in different modules or if/how modules share and work on object attribute data" Read the traits paper: http://www.iam.unibe.ch/~scg/Research/Traits/ http://www.iam.unibe.ch/~scg/Research/Traits/
- deleted 18y ago[deleted]
- LogicHoleFlaw 18y agoMan, _why knows how to just come out of nowhere and drop awesome stuff on us all. This is really slick.
- iamdave 18y agoAgreed, _why really makes me think of the days when hackers weren't doing things with the hopes of getting a paycheck in the end, but more because they had the know how, and they wanted to do it just to see if they could pull it off. It's an infectious virus that works rather brilliantly with the presentation, and quality of work this guy puts together.
- perezd 18y ago/me waits for web framework named: cauldron.
- justindz 18y agoThe animation framework is called motion. The unit test framework is called lotion. You know, to keep you from getting burned. The language partisans will have slavish devotion.
- judofyr 18y agoand the Rack-port: Crack!
- tlrobinson 18y agoSpeaking of Rack ports... a JavaScript one I just started a couple days ago, called Jack of course: http://github.com/tlrobinson/jack http://github.com/tlrobinson/jack
- tpinto 18y agook, so _why did it again. from time to time, this guy comes from nowhere and drops a little something of awesomeness. _why makes me feel sad and be ashamed to even touch a computer keyboard :/ this guy rocks.
- tectonic 18y agoWho IS this guy and how is he so productive and awesome?
- arockwell 18y agoI have no idea. _why is like a super hero hacker with a secret identity and everything.
- LogicHoleFlaw 18y agoI'm not sure I even want to know. I think the mystery is part of the appeal. I admit, I'm a Romantic at heart.
- mhartl 18y agoI'm pretty sure _why is really like twelve guys just messing with our heads.
- niqolas 18y ago+1 for mystique
- yan 18y agoWow, the technical and artistic output by him is amazing. I'd love it if he wrote a bit about how he operates, what his interests are and etc but I somehow feel that is outside his character.
- silentbicycle 18y agoNot to sidetrack things, but there is a bunch of cool stuff in the source for Lua. Whether or not it gets used directly, it is going to have a huge influence on the implementation of new languages. It has a bunch of novel ideas* (e.g. the register-based VM, the table optimizations) that have paid off big, it's very portable (due to being written in strict ANSI C), and it has a surprisingly small code base. It's pretty readable (http://www.lua.org/source/5.1/ http://www.lua.org/source/5.1/), full of examples of simple-but-efficient garbage collectors, string handling optimizations, etc. The designers have worked hard to keep it small and simple. * See "The Implementation of Lua 5.0" (http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf). It's 16 pages, and is a quick - but quite thought-provoking - read.
- bprater 18y agoGreat tips, thanks for taking time to post them!
- silentbicycle 18y agoAlmost forgot: There's also a reading guide for the Lua source (http://www.reddit.com/comments/63hth/ask_reddit_which_oss_codebases_out_there_are_so/c02pxbp http://www.reddit.com/comments/63hth/ask_reddit_which_oss_co...) by Mike Pall, the author of LuaJIT (http://luajit.org/ http://luajit.org/). The source for that is almost certainly a goldmine too (it's a cutting-edge JIT compiler, after all), but I haven't really looked at its internals yet. (Also, should be "simple-but-efficient garbage collection" above.)
- stcredzero 18y agoSomeone should make an OS out of something like this, with everything coded from the kernel up in Lua/Potion.
- silentbicycle 18y agoIoL4 (http://www.iol4.com/ http://www.iol4.com/) is an L4-based microkernel that boots into Io (http://www.iolanguage.com/ http://www.iolanguage.com/), which is another language that looks rather interesting. I've never got the Io VM to build on OpenBSD/amd64, which rules it out for me, though. I'd like to do that with a Forth or a Lisp one of these days, time permitting.
- ngvrnd 18y ago_Why is a very clever and subtle fellow. And to add insult to injury, he gets things done! Huzzah for _Why!
- MaysonL 18y agoDone! (And gets things smart).
- michaelneale 18y agoLooks like a good experiment - is good to keep asm knowledge in circulation. Also looks like it will do the fastest fib benchmark around !
- bprater 18y agoShould we come together as a community and give out hacker awards? Would it be fun? Someone like _why is a real inspiration to me personally.
- raygun 18y agoMe too!
- hcayless 18y agoThey should just get it over with and give him a MacArthur Genius Award....
- fauigerzigerk 18y agoHas anyone tried to run the ascii art piece from the README as a Potion program?
- dangrover 18y agoWhen I grow up, I want to be like _why.