meepdeew has quit [Remote host closed the connection]
rnmhdn has joined #racket
rnmhdn has quit [Ping timeout: 244 seconds]
dddddd has joined #racket
orivej has joined #racket
iyzsong has joined #racket
pie___ has quit [Remote host closed the connection]
pie___ has joined #racket
orivej has quit [Ping timeout: 250 seconds]
buyfn has joined #racket
jao has joined #racket
buyfn has quit [Quit: buyfn]
jhei has quit [Ping timeout: 260 seconds]
jhei has joined #racket
orivej has joined #racket
rnmhdn has joined #racket
rnmhdn has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 240 seconds]
<winny>
using megaparsack - I get expression/p: undefined; cannot reference an identifier before its definition https://gist.github.com/c0afbb1ebd0b6bc3a0b0c91d04549c25 - i think this is a flaw with how I designed the combiners - is there a proper or better way to defin a grammar like what my code tries to? This is for a hoc implementotion, btw
acarrico has joined #racket
JoshS has quit [Remote host closed the connection]
JoshS has joined #racket
pierpal has joined #racket
<winny>
Best idea I have - rewrite the grammer in chomsky normal form, that should work, not sure if that's the simplest or idiomatic
iyzsong has quit [Ping timeout: 268 seconds]
dustyweb has quit [Remote host closed the connection]
<jcowan>
Which Chomsky form? Most BNF grammars are type 2, whereas regular expressions are type 3. Algol 68 has a type 1 grammar with its own notation for it. I know of no computer languages that require type 0 grammars.
<winny>
I see: I sort of follow, but need to read up on the types. I recall rewriting CFGs in CNF and noticed it remove left-recursive production rules. So I think I could use that here?
<lexi-lambda>
winny: megaparsack provides a lazy/p combinator to defer the evaluation of a parser until it is used, but it looks like I forgot to document it.
<lexi-lambda>
winny: Also, your use of only-in + except-in is equivalent to just writing (rename-in data/monad [do :do]).
<winny>
lexi-lambda: thanks! I always forgot the source code is always available + easy to browse in most racket-enabled editors :)
<lexi-lambda>
It should be documented!
<winny>
indeed (:
<winny>
just looked at the syntax for lazy/p, a lot simple than i was guessing
jao has joined #racket
<lexi-lambda>
It might be better to make lazy/p only evaluate the parser expression at most once, but that wouldn’t really make it much more complicated than it already is.
<winny>
that seems like a good idea, i think my approach is abit to naive to be usable
g00s has joined #racket
orivej has quit [Ping timeout: 250 seconds]
notzmv has quit [Ping timeout: 246 seconds]
<cemerick>
I have a simple program that appears to be faster under typed racket, but only if its optimizer is turned off. Does that sound remotely plausible?
<lexi-lambda>
Does it use any libraries that are written in Typed Racket?
<lexi-lambda>
Well, if you are, I don’t see it. Maybe samth knows.
<lexi-lambda>
(Oh, except samth isn’t in the channel at the moment, it seems.)
<cemerick>
well at least I'm not alone in my intuitions
<cemerick>
happy to take any suggestions / golfed versions from anyone interested, FWIW
<lexi-lambda>
cemerick: FWIW, Racket’s I/O system is, I think, known to be pretty slow in general, relative to other things/languages. It wouldn’t explain the TR discrepancy, but it might be a bad thing to benchmark. I’d guess almost all the time is spent doing I/O.
<cemerick>
It's intended to be a very brutish gauge of allocation/GC/fn invocation perf. IO?
<cemerick>
I mean, if you want to characterize malloc & co as IO, I guess
<lexi-lambda>
Yeah, if you’re explicitly benchmarking I/O throughput, then it is reasonable. :)
<lexi-lambda>
Instead of specifying gen:custom-write, though, you could probably just use the #:transparent option to struct.
<cemerick>
lexi-lambda: thank you, noted.
sauvin has quit [Ping timeout: 250 seconds]
rnmhdn has joined #racket
<cemerick>
it's been soooo long since I've racketed, I might as well never have :-P
<cemerick>
now that I've fixed my plain-racket impl, the bigger concern is that TR of any flavour is slower than baseline racket, and not by a little
<jcowan>
cemerick: Inevitably so because of the typed<->untyped transitions
<cemerick>
jcowan: even if one fully types the program?
dbmikus has quit [Ping timeout: 246 seconds]
Sgeo__ has joined #racket
orivej has joined #racket
Sgeo_ has quit [Ping timeout: 268 seconds]
YuGiOhJCJ has joined #racket
dbmikus has joined #racket
dbmikus_ has joined #racket
dbmikus has quit [Ping timeout: 268 seconds]
FreeFull has joined #racket
mzan has quit [Ping timeout: 250 seconds]
pie___ has joined #racket
pie__ has quit [Ping timeout: 268 seconds]
<jcowan>
cemerick: Yes, because the Racket libs you are using are untyped
<cemerick>
jcowan: I suppose because the types of various things TR itself depends upon or re-exports can't be expressed
<cemerick>
(I'm not actually using any 3rd party libraries, tbc)
<jcowan>
I mean the core Racket code: car, cdr, cons, .... is not typed
pierpal has quit [Ping timeout: 240 seconds]
notzmv has quit [Ping timeout: 250 seconds]
dbmikus_ has quit [Read error: Connection reset by peer]
dbmikus_ has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
dbmikus_ has quit [Ping timeout: 244 seconds]
Fernando-Basso has joined #racket
dbmikus has joined #racket
mzan has joined #racket
Sgeo__ has quit [Ping timeout: 268 seconds]
<lexi-lambda>
cemerick, jcowan: There is no overhead for interacting with core untyped Racket libraries (that is, libraries included in `#lang racket`) from TR.
<lexi-lambda>
Or, at least, there isn’t supposed to be. :)
<cemerick>
lexi-lambda: if that's the case, then I guess I should write to the ML and see what's up
<lexi-lambda>
That’s probably a good idea.
<friscosam>
cemerick: just a random thought, have you tried it with a different numeric type instead of Float?
<cemerick>
friscosam: I happen to actually need floats for the domaun/project in question
<cemerick>
Oh, I'm actually using ints for the untyped impl!
<friscosam>
I actually thought there were more inexact numeric types in TR that you could try, oh well :)
<cemerick>
Yeah, the docs stress using floats in any case
lavaflow has quit [Read error: Connection reset by peer]