IRC Logs for #io Sunday, 2014-09-07

*** ElMonkey has joined #io01:12
prologicjer, I'm motivated to get back on the language design and implementation band wagon again :) specifically I'm attempting to re-write mio from scratch with the goal in mind of it's run-time being "fast enough". I'm planning on using RPython (and already have the lexer completed)01:14
prologicjer, my thoughts are now on parsing, compilation and a byte code instruction set01:15
prologicthoughts on what an instruction set would look like for an Io-style language? stack-based or register based?01:15
jeri'm tempted to get back into language design and implementation again too =]01:17
jercurrently waiting for my 3rd round of interviews for apple's swift team =]01:18
jerprologic, stack based gets you ease of implementation, and a very flexible programming model01:18
jerdownside is it's harder to optimize01:18
jerbut it does fit well with message passing01:18
jerregister based buys you ease of optimization, depends really on what oyu want to get out of it in the end01:19
jerif you're already headed that route, might i suggest not even worrying about bytecode and hit something like LLVM and go AOT01:19
jeranyway, instruction set wise on a stack based vm, outside of your stack manipulation instructinos, you'll also need a way to set up a way of calling your routines, a very fast hashing instruction will also be a must (if oyu intend on storing slots like the mainline does)01:22
jerbut if you're readed down that way, might i suggest instead of storing slots in a hash table like structure, you store them in an array and bind the slot names to a specific index01:23
jerthis will give you a bit nicer transition to AOT if you intend to go that way, and even if not, JIT will benefit from this approach01:23
prologicright01:25
jerprologic, honestly, if i were building something like io today, i'd probably be aiming to build an AOT compiler frontend, a simple runtime (ala objc, very lightweight)01:25
prologicthanks :)01:25
jerand hit some real hardware =]01:25
prologicknew you'd have some helpful insights :)01:25
prologicsure01:25
pdurbinat http://androidbackstage.blogspot.com/2014/07/android-developers-backstage-episode-10.html they talked about how the move from Dalvik to ART was partially motivated by wanting to support AOT.01:25
jerif you can bootstrap your frontend in python, you could even write all this in the language itself01:25
prologicbut as my skills/experiences a way behind yours in this field, I'll go down the stack-based vm route and use the rpython toolchain01:25
prologicso far so good anyway - lexer is working nicely01:26
jerpdurbin, i think the world is mostly done with JIT these days, outside of debuggers01:26
pdurbinok, haven't heard a ton about it01:35
prologicme neither01:38
prologicwhere's your source jer? :)01:38
pdurbin[CITATION NEEDED]01:38
pdurbin;)01:38
prologicfrom my perspective JIT(s) are going strong and the bees knees behind many popular languages :)01:38
prologicindeed :)01:38
prologicbut otoh I can see how AOT might be a better alternative01:38
prologicor at least an alternative01:39
jerheh sorry, was away01:40
jerprologic, of the new languages being built today, you'll find the trend more to targeting native code ahead of time01:41
jertypically because of what languages are being built01:41
jerfar fewer dynamic languages are being built, and far more hybrid or multiparadigm languages are being built01:42
jerlanguages easier to target to a machine architecture01:42
prologice.g?01:42
prologicGo?01:42
prologicSwift?01:42
jerRust, Go, Swift, i only leave out some of the java langauges because of well ... the jvm01:42
prologicRust?01:43
prologicDoesn't that compile to Javascript?01:43
prologicGo/Swift - sure01:43
jerno01:43
prologicoh wait01:43
prologicI was thinking of TypeScript01:43
prologicsorry :)01:43
jerRust compiles to LLVM IR, which then in turn is run through llvm to produce a native executable01:43
prologicokay01:43
prologicthat's three examples01:43
prologichybrids at least, are they all AOT?01:43
jerthere are plenty of other examples too01:44
jeridris instantly comes to mind01:44
prologicinteresting01:44
jerlanguages like swift have a runtime 01:45
pdurbinjer: clojure is a jvm language and seems to support AOT: http://clojure.org/compilation01:45
jercool that one i didn't know about01:47
jermost languages that target the jvm could easily target native code or llvm01:47
jerwith minimal effort01:47
jerlanguages in the last 5 years or so that have come up on the jvm have largely done so for interoperability reasons (help support the language with libraries via interop while native libs get built)01:48
jerit's a convenience backend rather than anything01:48
jerclojure, scala are two notable examples01:48
jerbut yeah there are a few exceptions of course -- elixir is a notable one01:48
jertargets otp/beam01:49
prologichttps://bitbucket.org/pypy/lang-smalltalk/src/7a6927034c2445fa4e25fb0c4f9d857a5f34a882/spyvm/constants.py?at=default01:49
prologichmmm01:49
jerand beam is a bytecode vm with jit01:49
prologictrying to design a minimal bytecode set for what I'mdoing01:49
jerprologic, i'd strongly suggest you also take a look at rubinius' vm01:50
jerif i were building a dynamic language today and set on bytecode with jit, i'd probably seriously consider targeting it instead -- if not, at least stealing as much as i could =]01:50
prologicor as many of the ideas from it :)01:51
prologicsure01:51
jersure01:51
jereven if i don't find myself on the swift team, i'm probably gonna build my own language again at some point in the near future01:51
pdurbinjer: but yours won't be dynamic01:51
jerbut it'll most definitely not be dynamic01:51
jerit'll be a functional langauge for sure -- a pragmatic language01:52
jerand i'd target it at systems level dev01:52
prologicif it's all essentially message passing though (io style) with activation bits don't you essentially need only a handful of instructions? push, pop, call, get, set01:52
jerwhen i say pragmatically functional, i don't mean extremist ala haskell, idris, clean, ...01:53
jerprologic, for io... you don't need too many instructions01:53
prologicsame sort of thing I want to buidl :)01:53
prologicfunctional, but not pure01:53
prologicwhat am I missing?01:53
jeryou need a way to create an object, map names to pointer sized offsets from that object (your vtable)01:54
prologicpush a message, pop a message, call it (activation), set a slot, get a slot01:54
jerso you need some load/store mechanism01:54
jeryou can push args onto a stack, then the name, and call01:54
prologicahh yeah01:54
jerthe method impl will pop off as much as it needs to01:54
prologica way to create new objects for set/get01:54
jeryou'll need a basic way to jump around01:54
prologicI will?01:54
jerwell you can probably deal with just calling =]01:55
jerbut that's still a jump01:55
prologici.e: JNE, JMP, etc?01:55
jeryou might benefit from having a jump instruction though01:55
jerthink of loops w/o functions01:55
prologictrying to think how that would work in Io :)01:55
prologicahh yeah01:55
jerwell, you have really two choices for loops01:55
prologicwell instead of (or they rea jumps really)01:55
jercontinuations in your ISA, or imperative constructs01:55
prologichave a way to save the stack, and re-enter it01:56
prologicala continuations01:56
jerthere's a certain elegance to continuations, but that adds complexity01:56
prologichaha01:56
prologic:)01:56
prologicPUSH, POP, GET, SET, NEW, (and a couple of instructions to save/resume the stack, not sure what to call them) :)01:58
prologicI forgot CALL01:58
prologic:)01:58
prologichttps://github.com/topazproject/topaz/blob/master/topaz/consts.py02:00
jeryou may end up with some specialized load instructions02:00
jerdepending on your calling conventions02:00
jeryou won't need any of those build instructions02:01
jernor the coerce02:01
jersend you'll just need one form (a call)02:01
jeryou might want a specialized version of send that doesn't traverse the inheritance graph (if you're gonna have one)02:01
jerbut yeah i think that's a good start02:02
pdurbinjer: will you have to relocate if you join the swift team?02:02
prologicyeah I've seen LOAD_CONSTANT_FLOAT02:05
prologicand LOAD_CONSTANT_STRING02:05
prologicetc a lot02:05
prologicso I'll need a few of those at least02:05
jerpdurbin, yeah 02:05
jerit's on site on the apple campus02:05
jerso bye bye costa rica if they make a good offer02:05
prologicjer, in my rewrite I'm planning on dropping inheritance altogether02:05
prologictraits only02:06
jerprologic, see that's where i'd like to start my language from if i end up building another02:06
jerADTs, and type classes (traits)02:06
prologicI'll keep you updated on how I go :)02:06
prologicgotta write my parser next02:06
prologicthen the compiler02:06
prologicyeah I want to build my type system around traits02:07
pdurbinjer: I listened to this whole series about dev at apple. pretty interesting: http://www.imore.com/debug-39-nitin-ganatra-episode-i-system-7-carbon02:07
prologicand leave very little implemented on the host side as possible (rpython)02:07
jerpdurbin, that's one of two podcasts i actually listen to02:07
jer=]02:07
pdurbinoh wow, a whole transcript. that's nice02:08
pdurbinjer: is the other programming related?02:08
jerpdurbin, not really no02:08
jerDebug and Vector02:08
pdurbinhuh. maybe I'll check it out02:10
prologichttps://gist.github.com/therealprologic/4f6502e8e34c93a7426402:37
prologichmmm02:37
*** gatesphere has quit IRC04:12
*** NetBeast has joined #io06:21
*** NetBeast has quit IRC06:46
*** ryanu has quit IRC07:43
*** bjz has quit IRC07:46
*** bjz_ has joined #io07:46
*** TheMonkey has joined #io08:13
prologicjer, why do I need to push/pop messages onto the stack? (mental block?)08:13
*** ElMonkey has quit IRC08:17
*** hashmal has joined #io09:15
jerprologic, so that your call can pop them off -- technically you might not even need full on messages13:22
jerthat is to say, you could just push on a string literal if you're content with losing some metaprogramming abilities -- or at least having to write a term unwinding engine in front of your first stage if you want it13:23
jers/unwinding/rewriting/13:24
jerbah too early in the morning13:24
prologicjer, https://bitbucket.org/prologic/mio-lang-rewrite13:28
prologicall the code is here13:28
prologicI've completed stubs (basically) of lexing, parsing, compiling and interpreting13:29
prologicright now it can interpret a terminator13:29
prologic:)13:29
jer=]13:29
prologicsee I was going to make my EVAL instruction pop things off the stack13:30
prologiclike the name of the message and any arguments13:30
*** NetBeast has joined #io13:30
jerprologic, here's the thing, you could write a pretty naive vm with almost no work13:33
jeri mean yeah it's non-trivial, but only just barely13:33
jerio's calculus is very small13:33
jeryou can ignore most of the apis in fact13:33
prologichmm?13:34
jeryou need a way of creating objects, a way of pushing things like literals onto the stack, a way to invoke a message, and a way to save enviornment state as well as restoring it later13:34
jerthere's really nothing more to io's core13:34
prologicgot all that :)13:34
jerright13:34
prologicI hope :)13:34
prologic*nods*13:35
prologicI do feel like some of the instruction names are a bit misleading13:35
prologicbut at the end of the day they're bits and bytes :)13:35
jersure13:36
jeri think you may find at some point you'll wish you'd have built this as a register machine13:36
prologicprobably13:40
prologicit kind of makes more sense really13:40
prologicsince an Io lang is all about objects and slots13:41
prologic(attributes as I call them)13:41
prologicwould you even still have a stack at all?13:41
jerdepends all on your environment; but general purpose machines tend to be more built around register machines since they're more flexible, you have to invoke fewer instructions -- yeah you pay a bit more in instruction decoding, but oh well13:41
jerdepends on what my goals are too =]13:41
*** gatesphere has joined #io13:44
prologicoh well13:45
prologicbed time :)13:45
jerprologic, heh later man13:45
prologiccya good luck with the job interviews13:45
jerthanks13:45
*** NetBeast has quit IRC14:22
*** bjz_ has quit IRC16:47
*** bjz has joined #io16:47
*** ijon_ has joined #io16:49
*** ryanu has joined #io17:18
*** ryanu has quit IRC17:18
*** ryanu has joined #io17:18
*** bjz has quit IRC17:33
*** bjz_ has joined #io17:33
*** daniellll has joined #io18:48
*** daniellll has quit IRC18:48
*** gatesphere has quit IRC19:19
*** ryanu has quit IRC19:44
*** ryanu has joined #io19:47
*** fredreichbier has joined #io19:56
*** gatesphere has joined #io19:56
*** petr has quit IRC20:06
*** petr has joined #io20:08
*** ElMonkey_ has joined #io21:12
*** TheMonkey has quit IRC21:16
*** jer has quit IRC21:21
*** ijon_ has quit IRC21:22
*** ElMonkey_ has quit IRC21:27
*** jer has joined #io21:27
*** ElMonkey has joined #io21:28
*** Thor has joined #io21:49
*** hashmal has quit IRC22:37
*** fredreichbier has quit IRC22:39
*** NetBeast has joined #io23:22

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!