dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 256 seconds]
edr has quit [Quit: Leaving]
nfc has quit [Ping timeout: 246 seconds]
nfc has joined #ocaml
pi3ce has joined #ocaml
szkl has joined #ocaml
trev has joined #ocaml
trev has quit [Quit: trev]
trev has joined #ocaml
dnaq has quit [Remote host closed the connection]
dnaq has joined #ocaml
<greenbagels>
oh WOAH the ocaml.org/docs page now references CS3110 and RWO? :o
<greenbagels>
"now" as in "since i last noticed" :p
bartholin has joined #ocaml
<greenbagels>
Also; so RWO has a section describing the difference between Hashtbl and Map; but I believe they're describing those data structures provided by JS's Base module, so I'm unsure what claims are unique to that
<discocaml>
<functionalprogramming> thats the problem
<greenbagels>
but what i gather is that ocaml out-of-the-box provides the 3 major types of associative arrays: 1.) a list-based one, in the List module; 2.) a hash-based one, in the Hashtbl module; and 3.) a binary tree-based one, in the Map module
<greenbagels>
are the major differences between these 3 just the standard performance implications of the implementations, plus the mutable vs immutable nature of the three?
<dh`>
I don't entirely follow the question because there's a lot of kinds of tree-based maps
<greenbagels>
yeah sorry im rambling a bit
<greenbagels>
basically in my mind when looking at these 3 options there's like 2 things that stand out most immediately to me
<greenbagels>
1.) the choice of data structure used in the implementation, which in my mind largely determines the performance characteristics of lookups, updates, etc.
<greenbagels>
2.) whether the operations over the type are side-effecting or not / whether the type is mutable
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Serpent7776 has joined #ocaml
bartholin has quit [Quit: Leaving]
dhil has joined #ocaml
dnh has joined #ocaml
edr has joined #ocaml
bartholin has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 276 seconds]
nickiminjaj has joined #ocaml
alexherbo2 has joined #ocaml
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discocaml>
<deepspacejohn> Am I correct to believe that the only way to guarantee evaluation order is with let-bindings?
<discocaml>
<._null._> If you consider `;` as a form of let-binding, since they do in the same way
<discocaml>
<._null._> Also, the condition in an if/then/else and the scrutinee of a match are evaluated before the branch
<discocaml>
<deepspacejohn> ah, yes that sounds right. That doesn't apply for what I'm doing though.
<discocaml>
<deepspacejohn> I'm actually trying to write a DSL that's using an infix operator to simulate `;` to sequence its "unit" expressions, and I just realized everything's evaluating backwards 🤦♂️
<discocaml>
<._null._> Unless I'm missing something, the only places where evaluation order isn't defined is arguments, in either function application or "constructor application"
nickiminjaj has joined #ocaml
<reynir>
I always get the arguments to `dune cache trim` wrong - I always think --trimmed-size will trim the cache down to that size but no that's what --size does
<discocaml>
<elliottcable> Hm. Is there any well-liked-but-smallish library that defines an interoperable "this is, indeed, a _unicode_ string" type? before we go roll our own, I thought I'd check; but I didn't see anything in uutf or w/e
<companion_cube>
ah sadly no
<discocaml>
<elliottcable> there's plenty of tools/implementations of doing the actual work that we'll need to do at the boundaries between unicode/raw-bytes; the only real remaining issue is whether we wrap all that into a `UTF8.t` of our own, or use soemthing vaguely standard
<companion_cube>
we could absolutly have `type Ustring.t = private string`
<discocaml>
<elliottcable> is there a batman-cape emoji — a very "sounds like a job for … ~companion_cube!~" moment :P
<discocaml>
<elliottcable> v. ocaml-trace-y; "this thing is almost a no-op, can we please just _agree_ on the one thing? thanks"
<companion_cube>
ahah yeah, having people coalesce around a particular solution is the *hard* part alas
<discocaml>
<elliottcable> psh no it's not, just be loud and aggresive, that solves all problems, right? :P
* discocaml
<elliottcable> ducks
* companion_cube
slaps @elliottcable around with a large trout
<companion_cube>
I mean that's where I'd hope dbunzli would just propose that to the stdlib
<discocaml>
<elliottcable> i remember a deep discussion this on a GitHub issue on ocaml/ocaml, but i can't find it with a quick ddg
<companion_cube>
when even the search engine people can't find it… :p
<companion_cube>
that said I'm not sure the stdlib would accept stuff like that :/
<discocaml>
<elliottcable> oh god am i "search engine people now" halp
<companion_cube>
:D maaaaybe?
<discocaml>
<elliottcable> anyway low-key expect opinionated `ocaml-unicode` from me, then, if nobody else is gonna do it, soon, big shrug
<companion_cube>
you're thinking of a encompassing library? that collates together the uutf, uucp, etc. alongside new types?
<discocaml>
<elliottcable> that's ambitious; probably not — but I'm open to thoughts? (… or somebody else doing it better than I will :P)
<discocaml>
<elliottcable> was thinking just litearally a private type; and wrappers for the uutf/uucp functions that should take/return that private type, but not the rest of uutf/uucp
<companion_cube>
actually uutf might not be needed after 4.14
<companion_cube>
since the stdlib has codecs
<discocaml>
<elliottcable> oh yeah, I forgot; fantastic
<companion_cube>
no I mean, you could have a `utf8_string` library with mostly the type alias and helpers
<companion_cube>
and then `utf8_string.normalize`, `utf8_string.compare`, etc. that come with optional uu** dependencies to add features :)
<discocaml>
<elliottcable> but yep, precisely that — maybe a GADT over an `encoding` variant, though, so I don't need a dozen modules …
<companion_cube>
do you need multiple encodings, or do you want to embrace the truth that only UTF8 is worthy?
<companion_cube>
🙃
<discocaml>
<elliottcable> hahahaha. if i'm keeping this inside ahrefs, definitely waaaaay too lazy to make it fancy; but if i want to try and convince people to accept it (and by "accept it", realistically, I mean "publish submodules that take/return `Unicode.t` as an addition to the usual ones operating over `bytes`"), then I suppose i have to be not-lazy and try and make it general >,>
<companion_cube>
just don't call it `Unicode.t` plz
<companion_cube>
more descriptive
<companion_cube>
… like `Utf8_string.t` say
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
<discocaml>
<elliottcable> yeah, I don't want to conflict w/ anybody, either. (looking at you, compiler-lib `Trace` module …)
nickiminjaj has joined #ocaml
<companion_cube>
lolol yeah
<companion_cube>
so annoying
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nickiminjaj has joined #ocaml
<discocaml>
<dalpy> Hello, where do I ask questions about menhir?
waleee has quit [Ping timeout: 245 seconds]
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discocaml>
<dalpy> damn, I'll cut to the chase then: has anyone ever played around with menhir's new syntax? I don't understand why binding the same rule several times with a `~` pattern is not allowed. This example grammar raises the error:
<discocaml>
<dalpy> ```
<discocaml>
<dalpy> %token TRUE "true" FALSE "false" IF "if" THEN "then" ELSE "else" EOF
<discocaml>
<dalpy> suppose `Ast` is an external module that defines the `True` `False` and `If` constructors
<discocaml>
<._null._> What error do you get ?
<discocaml>
<dalpy> Error: The variable expr is bound several times.
<discocaml>
<._null._> Then apparently it doesn't support the syntax if you need to make more than one call to the same rule, you'll have to name them (I suspect the production won't need changing)
<discocaml>
<dalpy> naming rules, aside, the semantic action changes to `{ Ast.If (e1, e2, e3) }`, which kinda sucks
<discocaml>
<dalpy> naming rules aside, the semantic action changes to `{ Ast.If (e1, e2, e3) }`, which kinda sucks
<discocaml>
<dalpy> might open an issue on menhir's GitLab repository for this
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]