00:57
FROGGS[mobile] joined
01:07
lizmat joined
01:13
FROGGS[mobile] joined
01:48
ilbot3 joined
|
|||
FROGGS[mobile] | \o/ | 05:33 | |
06:55
FROGGS joined
|
|||
psch | here, too: gist.github.com/peschwa/f399cf10914f1d287a74 | 07:14 | |
where am i going wrong? the moar attempt there complains with "At Frame 1, Instruction 5, op 'wval', operand 0, MAST::Local of wrong type (4) specified; expected 8" | 07:15 | ||
i'm not sure how else i would get the lexical lookup for Failure there | |||
i recognize that maybe having a lexical lookup for Failure in every p6typecheckrv is probably somewhat slow, but i don't have an idea for either backend to hang some kind of less-expensive reference or something | 07:16 | ||
07:34
zakharyas joined
07:40
Ven joined
|
|||
JimmyZ | psch: $*REGALLOC.release_register($isfailure, $MVM_reg_obj); | 07:56 | |
psch: should be $MVM_reg_int64, hope this will fix the problem. | 07:57 | ||
psch | JimmyZ: thanks, that lets me compile again at least, even if the patch doesn't have the desired effect | 09:35 | |
09:52
TEttinger joined
|
|||
TEttinger | hello! one of my friends is currently designing a smalltalk-esque minimal language, and I'm wondering if he would benefit from targeting MoarVM instead of rolling his own to-C translator or generating X86, etc. | 09:54 | |
JimmyZ | TEttinger: I think only if he uses nqp | 09:56 | |
TEttinger | I had a bit of a hard time figuring out what MoarVM... is... to be honest. the features page lists many language features that I'd think would be part of a high-level language like Perl, but above that it says MoarVM provides only representations | ||
JimmyZ | TEttinger: Moarvm provides only represetiations | 09:57 | |
the higher one is NQP | |||
which is good for writting a compilier | 09:58 | ||
TEttinger | so when it says under Language Feature Support, Continuations (single shot; partial multi-shot support) | ||
that's a representation that it knows how to support, if you write it in NQP? | |||
JimmyZ | yeah | 09:59 | |
TEttinger | ok, makes sense | 10:00 | |
JimmyZ | NQP is a compiler tool | ||
TEttinger: github.com/edumentab/rakudo-and-nq...als-course | 10:01 | ||
which is good for better understanding | |||
TEttinger: github.com/edumentab/rakudo-and-nq...e/gh-pages for pdf | 10:02 | ||
TEttinger | I'm currently writing my own language in Lua, which has been sorta odd. most things have been surprisingly easy, as I suspect it would be if I was using NQP instead of Lua, but Lua doesn't actually have true regexes, which is weird. | ||
the parser uses a parser expression grammar lib, and it is just nasty | |||
JimmyZ | TEttinger: there is a course about writting a php compiler or ruby compiler by nqp | 10:03 | |
TEttinger | the only real reasons I have for not using MoarVM right now are simple: I didn't know about it until recently, I don't know how well it performs relative to LuaJIT (this matters the least right now), and I don't know if MoarVM provides any way to interop with C or another host language like LuaJIT's FFI does | 10:04 | |
other than that, it looks like a great way to write a language | 10:05 | ||
JimmyZ | TEttinger: Moarvm providers nativecall by dyncall | ||
TEttinger | that sounds good | ||
I don't know a thing about it though :) | |||
JimmyZ | TEttinger: moarvm.org/features.html says Native calling, passing pointers, arrays, structs, and callbacks | 10:07 | |
TEttinger | is NQP a much smaller language, in regards to how much you need to learn to get up and running, than Perl 6? | ||
I know Perl 6 has uh, "pretty much every feature the other guys have, and then some" | |||
JimmyZ | TEttinger: yeah. | ||
NQP means Not Quite Perl 6 | 10:08 | ||
psch | the edumentab slides are very good, imo | ||
TEttinger | cool | ||
psch | and nqp/examples has the rubyish implementation, iirc | ||
although i'm not sure that's still up-to-date | |||
JimmyZ | and there is a python implementation too ,which is up-to-date | 10:09 | |
:P | |||
psch | oh, right! | ||
github.com/arnsholt/snake arnsholt++ | |||
TEttinger | wow, this looks excellent | 10:25 | |
the language I'm making is "basically Clojure, minus some of the immutable data", so having Perl (and NQP) be conscious of the differences between compile and runtime is very important and useful | 10:26 | ||
since true lisp-style macros have been the most challenging part of the dev so far | 10:27 | ||
JimmyZ | yeah, I saw the Clojure marco implementation is very tricky :P | 10:31 | |
psch | TEttinger: github.com/masak/007/ has musings about Perl 6 macros, maybe that's of use to you too | 10:32 | |
TEttinger | JimmyZ, part of it turned out much simpler by virtue of lua's extremely simple module system | 10:33 | |
lua doesn't have namespaces for symbols, when you require another module you typically assign it to a table, and a module is really just a table of name keys and values that correspond to what you defined for those names | 10:34 | ||
like math is just {sin=<native code implementation of sin>,pi=3.141592653...} | 10:35 | ||
so syntax quote in clojure typically has to namespace each symbol as a result of being on the JVM with its packages | 10:36 | ||
I don't! | |||
JimmyZ | MoarVM knows nothing about namespace. | 10:52 | |
:P | |||
TEttinger | interesting stuff, psch, read a bit of that | 10:57 | |
so is there a difference between a QAST and a MAST? | 11:36 | ||
the MoarVM site mentioned an MAST as the starting point, the internals course calls it a QAST | 11:37 | ||
psch | QAST gets compiled to MAST, as i understand it | 11:43 | |
as in, NQP compiles to QAST and the moar backend compiles it to MAST, which moar compiles to bytecode | |||
TEttinger | ah, ok | 11:44 | |
thanks for the help, it's nice having a friendly channel! | 11:45 | ||
hm, producing an AST is ideal for my language since currently that's the only representation of the code that Lua sees at runtime, a big ugly tree as a nested series of tables. there isn't always a distinction between tables produced by functions and tables that mean nodes in the AST, and Moar seems like a great target if only because the code would be more clear | 11:49 | ||
psch | well, in the end you'd probably rather target NQP | 11:52 | |
which means you could write a lua backend and we get that for free for Perl 6 :) | 11:53 | ||
that's not a recommendation to implement a lua backend for NQP, i have no idea what kind of efforts would be behind that | |||
more tongue-in-cheek | |||
TEttinger | err, yeah I would be producing a QAST huh | 11:54 | |
hm, then it could run on the JVM too | |||
psch | yup | ||
TEttinger Mr. Burns hands | |||
excellent. | 11:55 | ||
psch | there's also a javascript backend in the works somewhere... | ||
12:19
Ven joined
|
|||
arnsholt | Has anyone tried checking MoarVM with the clang static analyzer? | 12:24 | |
TEttinger | heh, wow, someone beat me to the punch! now I just need to learn perl AND japanese! github.com/tokuhirom/Perl6-Renshu/...r/nqp-lisp | 12:57 | |
tadzik | haha | 13:13 | |
oh, that's plenv author :) | 13:14 | ||
#122: (print "hoge") | |||
I now imagine that Japanese have a meme with a hog that does "wow, much this, many that" | 13:15 | ||
I don't know what hoge actually means, I could've just said something very insensitive | |||
nebuchadnezzar | TEttinger: even the comments in the code are in japanese ;-) | 13:45 | |
TEttinger | yep! | ||
nebuchadnezzar | That was maybe a bad think to support unicode in source ;-) | ||
s/think/thing/ | 13:46 | ||
TimToady | my japanese dictionary has no "hoge" in it | 13:49 | |
hogei means "whaling", if you stretch the /e/ into /ei/ | |||
14:03
Ven joined
|
|||
masak | tadzik: I implore you to create a hoge image. | 14:33 | |
TEttinger | hoge base? www.factzoo.com/sites/all/img/mamma...g-face.jpg | 14:38 | |
tadzik | beautiful :) | ||
imgur.com/kTiVZES hoge | 14:40 | ||
nebuchadnezzar | č± ć | 14:44 | |
TEttinger | fantastic. | ||
15:09
JimmyZ_ joined
|
|||
nebuchadnezzar | MoarVM is monthly released around 20th or 21th, right? | 15:45 | |
hoelzro | nebuchadnezzar: I'll be cutting a release later tonight | 15:47 | |
unless someone wants to do it for me ;) | |||
nebuchadnezzar | ok thanks, I think we'll skip upload of Debian package for 2015.05 and work on 2015.06 | 15:49 | |
japhb | nebuchadnezzar: For historical reasons, Rakudo is usually released the Thursday after the third Tuesday of the month, and MoarVM is released somewhat before that. | ||
TEttinger | wow, this is kinda overwhelming all of a sudden. it looks like writing this Lisp in NQP is the best option I have now, except for one small detail... I don't know any Perl yet. How should I get started with hacking on NQP stuff? download Perl 6, swap stuff out over time? | 15:54 | |
japhb | TEttinger: Have you gone through the courseware for that edumentab course? | 15:58 | |
psch | TEttinger: the edumentab slides are probably your best from-the-ground-up intro | ||
TEttinger | the two things I didn't get from that were a) what software am I actually using here, there are multiple backends but I don't know what I should actually be compiling here, and b) absolute perl basics, but I think I have inferred most of that as I went through | 16:00 | |
like, @* is the sigil for a dynamically bound list, right? | 16:01 | ||
is it different from *@ ? | |||
PerlJam | TEttinger: yes. | ||
psch | $ perl Configure --backends=moar --gen-moar --prefix=$PREFIX --make-install # builds and installs you nqp-m | ||
PerlJam | TEttinger: maybe the synopses can help with some of that? | 16:02 | |
psch | from the nqp root | ||
TEttinger | aaaaalso I'm on windows | ||
PerlJam | TEttinger: design.perl6.org (for the synopses) | ||
TEttinger | thanks | ||
psch | doc.perl6.org (the "Language" tab, mostly) is probably a good idea to keep handy as well | 16:03 | |
the .msi for windows is 2015.03 iirc? so the nqp in there is like 3 months | |||
oh, but jnthn++ runs windows too i think, so maybe he can give pointers how to build NQP there | 16:04 | ||
TEttinger | jnthn, the animal facts author in the course? :) | 16:06 | |
PerlJam | That's the one | 16:08 | |
Also one of the primary developers for Rakudo | |||
16:14
Ven joined
|
|||
nebuchadnezzar | japhb: ok, so packaging next MoarVM release will permit to work on nqp and rakudo | 16:16 | |
TEttinger | so... rakudo is a frontend that handles the full Perl 6 language and outputs a QAST that any MoarVM, the JVM backend, and ParrotVM can all use? | 16:26 | |
am I understanding this right? | |||
psch | the QAST is for NQP | 16:27 | |
and gets translated into MAST, JAST (and PAST in the past) for the backends | |||
at least that's how i understand it, as at least MAST nodes can be written manually as well | |||
TEttinger | so then what is rakudo? a standard for perl 6, an implementation of perl 6 that produces ???, a packaged/versioned set of tools from multiple Perl 6 projects? | 16:29 | |
PerlJam | TEttinger: Rakudo is a Perl 6 implementation. | 16:30 | |
psch | Rakudo is a Perl 6 implementation in Perl 6 and NQP | ||
TEttinger | does Rakudo have multiple backends, of which Moar is one of them? | 16:32 | |
or is that NQP that has backends | |||
japhb | I believe jnthn++ has another set of slides that explain the stack that is Rakudo | ||
TEttinger: Have you seen his talks page? | 16:33 | ||
TEttinger | nope | ||
japhb | TEttinger: jnthn.net/articles.shtml | ||
psch | there's an svg... github.com/rakudo/rakudo/blob/nom/...ecture.svg | ||
TEttinger | I really just started looking at perl-related stuff in the last 12 hours | ||
I know that perl 6 has had some cutting edge features for a while, I didn't realize how pretty-much-production-ready almost everything is | 16:34 | ||
looking at the future plans for Moar, it all seems like optimizations, not filling in gaps | |||
psch | yeah, the gaps are mostly in rakudo at this point i think | 16:35 | |
JimmyZ_ | it is easy to run nqp on windows, just download 'strawberry perl ' and git | ||
japhb | TEttinger: Here's a useful one of jnthn's talks from before he revealed MoarVM, when the backends were just Parrot and JVM: jnthn.net/papers/2013-yapceu-jvm.pdf | ||
But it gives a decent idea of the layered architecture, IIRC | 16:36 | ||
16:43
japhb_ joined
16:44
vendethiel- joined
|
|||
TEttinger | so... can you build NQP with rakudo star (binary distribution from rakudo.org/downloads/star/ ) ? does NQP need perl 5 specifically to build, or is 6 backwards compatible enough? | 16:52 | |
psch | if you have R* you have NQP | 16:53 | |
to build you'd need perl 5 and git as JimmyZ_++ said, not enough dogfooding yet to have a Configure.pl6 ā if that's even desirable, i don't know | 16:55 | ||
JimmyZ_ | install the msi , and you will have NQP | ||
TEttinger | ok | ||
so I can use the NQP in R* to build, say the Snake that was linked earlier? | 16:56 | ||
japhb_ | TEttinger: The assumption is that perl5 is available "everywhere", and less painful to write configure scripts in than, say, bash. | ||
TEttinger | github.com/arnsholt/snake this one | ||
JimmyZ_ | yeah | ||
TEttinger | muy excellente | ||
jnthn | evening, folks o/ | 16:58 | |
psch | o/ jnthn | 16:59 | |
jnthn | Summary of NQP: a self-hosting compiler for a subset of the Perl 6 language, along with various libraries for building compilers (including targeting different VMs). | 17:00 | |
psch | jnthn: not quite getting the Failure thing from yesterday ported to moar... irclog.perlgeek.de/moarvm/2015-06-17#i_10760551 | ||
jnthn: JimmyZ_++'s suggestion fixed the error, but semantics still don't work out | 17:01 | ||
i'm wondering if there's somewhere else that lets the error through or if i just don't grok moar :s | |||
jnthn | Where's your current patch? | ||
psch | (where "error" means "create the TypeCheck::Return and throws it"...) | ||
hold on, let me update | 17:02 | ||
updated the gist, that's the last thing i tried | |||
jvm bit is obviously the same | 17:03 | ||
calling "not_i" didn'T work out at all, but that was a "maybe i have the truthiness the wrong way around" guess | |||
jnthn | gosh that's a weird way to do it... | ||
psch | well i have no idea what i'm doing :P | ||
on jvm it seems simple and logical | |||
i can just call getlexcaller and everything works | 17:04 | ||
but trying that on moar gave me a "QAST::Op in WVal but not in SC" iirc | |||
not sure about the WVal there | |||
jnthn | Why get getlexcaller? | ||
A straight getlex (by name) would do it | |||
psch | i have no idea how else to find Failure | ||
oh | |||
jnthn | For Moar I'd emit a const_s "Failure" and then a getlexstatic_o so spesh knows it can cache/optimize the lookup | 17:06 | |
(and then istype) | |||
psch | ah | ||
yeah that sounds like something i hoped would be possible there | |||
i was aware that a lexical lookup for Failure for every return type constrained sub could be somewhat costly | 17:07 | ||
jnthn | Yeah, I'm not too thrilled with it | ||
But at least this way hot-path code has a good chance of it being optimized out | |||
psch | thanks, i'll try and get that in | 17:11 | |
17:20
brrt joined
17:39
zakharyas joined
|
|||
TEttinger | so... MoarVM has been gaining pretty steadily in its performance, right? how does it compare to the JVM rakudo? | 18:12 | |
it already smokes past Parrot, right? | |||
jnthn | Tends to beat Parrot from "a bit" to "a load" depending on benchmark. | 18:13 | |
TEttinger | the primary thing I care about is startup time when I am doing certain kinds of programming, and I typically use clojure for those things right now. despite clojure on JVM having atrocious startup time | 18:14 | |
I understand that scripty stuff is, how do you say... something Perl is really good at? :D | 18:15 | ||
but the more I read about NQP the better and better it seems | 18:17 | ||
you wonder why a high level language meant for compiler construction hasn't been made before... | |||
jnthn | We've been working hard on getting startup time down. | 18:18 | |
TEttinger | I guess in part because there haven't been many language projects as ambitious as perl 6 | ||
jnthn | (With decent success) | ||
TEttinger | jnthn, I saw the perl guts thing about taking ordering info out of hashes to save on memory | 18:19 | |
that's an interesting opt | |||
jnthn | Yeah, was worthwhile. Didn't win much on speed though. | ||
But nice for memory | |||
Lazily deserializing meta-objects has been one of our bigger "clever" startup speed wins. | 18:20 | ||
TEttinger | is there any way to get the ordering info anyway? | ||
one of the things that is really irritating on occasion in clojure is that maps (hash equivalent) and sets are not sorted in any way | 18:21 | ||
jnthn | You'd need to keep it out of band at the moment | ||
TEttinger | that's fine, yeah | ||
jnthn | You couldn't rely on it before anyways. | ||
TEttinger | ah ok | ||
jnthn | Since on the JVM we didn't keep order | ||
TEttinger | right, JVM used a different hash | ||
jnthn | We could potentially provide some "ordered hash" representation. | 18:22 | |
TEttinger | nah, I wouldn't worry about it, it makes sense as a userspace thing | ||
it's kinda funny though how calling keys on a map in clojure doesn't return a set | |||
because sets don't have order, if you tried to match up a key set to a val set you would always be mismatched | 18:23 | ||
*val seq | |||
18:24
FROGGS joined
|
|||
TEttinger | the stuff I want to explore in the Lisp I'm working on was initially just "make clojure, without the immutable stuff because it's really hard, then try to implement domains", where domains are first-class keysets or indexing methods to access values in a collection | 18:25 | |
and I'm kinda in a flurry of ideas now, because perl 6 adds a lot of options to what that could mean | 18:26 | ||
junctions as indices, for instance | |||
jnthn | I thought the value/identity separation in clojure was the main interesting thing about clojure. ;) | 18:33 | |
But I've only read about it's approach, not written it, so I'm probably misinformed :) | |||
FROGGS | o/ | ||
TEttinger | jnthn, it's an interesting Lisp. definitely trying hard to be practical, lots of stuff meant for interop with Java initially, now for JS too. | 18:42 | |
the biggest strength of clojure in practice is probably the "seq abstraction", where any of the clojure collections, and most java collections (pretty much all, anything with an iterator) can be converted to a seq, and all functions that expect a general collection expect a seq instead of special-casing every single collection they can take | |||
you can do line-seq on a large string, turning it into a seq of the lines in the string | 18:43 | ||
clojure handles nested heterogeneous data extremely well, and is fairly terse, though not as much as perl | 18:44 | ||
some common lispers joke that clojure is "lisp meant for one-liners" | |||
it certainly compresses well. ideone.com/L0eHc6 is the expanded, slightly improved version of, well... | 18:45 | ||
,(let[a #(apply str(flatten %))r repeatedly p partition N rand-nth n #(a(N(concat(repeat %"")(mapcat p[1 2 3]%&))))v #(n 0"aioeu""iaai")w(fn[](let[b(n 6"!.""""...")s[(n 0"STKNYPKLG""GlThShNyFt""ZvrCth")(r(N[1 2])#(do[(v)(n 9(map str"'-"(r 2 v)))(n 0(concat"lpstnkgx"[(N["h""gl""gr""nd"])(v)])"rlthggghtsltrkkhshng")]))]][b(if(seq b)[" "s][(n 3",")" "(.(a s)toLowerCase)])]))](re-find #"[A-Z].+"(a[(r 500 w)"."]))) | 18:46 | ||
meant to fit in IRC message limits | |||
FROGGS | and they say Perl is line noise :D | ||
TEttinger | haha | 18:47 | |
yeah, the cleaned up version is a lot more than one line | |||
FROGGS | sure | ||
TEttinger | there's some cool features at play there | ||
FROGGS | I do not expend that this would be the common way to write it | ||
TEttinger | not at all common | ||
like this snippet, (concat"lpstnkgx"[(N["h""gl""gr""nd"])(v)]) | 18:48 | ||
first, strings can be next to each other, they don't need whitespace or commas, that explains part, but the cool thing is that concat takes a sequence, not a string | 18:49 | ||
it converts "lpstnkgx" to a seq of chars, then concatenates onto the end of that seq a random string drawn from "h", "gl", "gr", "nd" with a random vowel after it (v is defined earlier, N is just random element from collection, aliased earlier) | 18:50 | ||
this is, in the clearer version, more explicit. it actually names a list of valid consonants, etc | 18:51 | ||
but that takes too many chars to be in one IRC message! | |||
FROGGS | hehe, nice | 18:52 | |
TEttinger | I don't really have an aversion to symbols anymore, I think I did at first in clojure, but then I really started realizing how much shorter some code can be | ||
anyway, I'm looking forward to doing a blitzkrieg learning of perl and NQP | 18:54 | ||
FROGGS | feel free to ask here or in #perl6 | 18:58 | |
20:05
oetiker joined
20:34
colomon joined
21:51
colomon joined
|