companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Tuplanolla has quit [Quit: Leaving.]
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
domq has joined #ocaml
domq has quit [Quit: domq]
rgrinberg has joined #ocaml
<hannes> reynir: I suggest to disable the cache, see https://github.com/ocaml/dune/issues/7819#issuecomment-1840946723 "cache at its current state is indeed problematic" (and I've suffered quite a bit from it, including it filling up my hard drive)
waleee has joined #ocaml
nickiminjaj has quit [Quit: Textual IRC Client: www.textualapp.com]
domq has joined #ocaml
<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
<companion_cube> https://c-cube.github.io/ocaml-containers/last/containers/CCUtf8_string/index.html I mean there's this, but it should be in its own library (or stdlib, really)
<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…]
nickiminjaj has joined #ocaml
nickiminjaj has quit [Changing host]
nickiminjaj has joined #ocaml
<discocaml> <elliottcable> here is probably fine; https://dontasktoask.com/
<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>
<discocaml> <dalpy> %start <expr> main
<discocaml> <dalpy>
<discocaml> <dalpy> %%
<discocaml> <dalpy>
<discocaml> <dalpy> let main :=
<discocaml> <dalpy> ~ = expr; EOF; <>
<discocaml> <dalpy>
<discocaml> <dalpy> let expr :=
<discocaml> <dalpy> | "true"; { Ast.True }
<discocaml> <dalpy> | "false"; { Ast.False }
<discocaml> <dalpy> | "if"; ~ = expr; "then"; ~ = expr; "else"; ~ = expr; <Ast.If>
<discocaml> <dalpy> ```
<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…]
nickiminjaj has joined #ocaml
nickiminjaj has quit [Client Quit]
tomku has quit [Ping timeout: 264 seconds]
tomku has joined #ocaml
pieguy128 has quit [Quit: ZNC 1.8.2 - https://znc.in]
<discocaml> <._null._> It doesn't work if you keep `<Ast.If>` ?
pieguy128 has joined #ocaml
Putonlalla has quit [Ping timeout: 252 seconds]
nickiminjaj has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
domq has quit [Quit: domq]
rgrinberg has joined #ocaml
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nickiminjaj has joined #ocaml
Putonlalla has joined #ocaml
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nickiminjaj has joined #ocaml
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nickiminjaj has joined #ocaml
<discocaml> <dalpy> it actually does, silly me not keeping that part. Thank you
nickiminjaj has quit [Read error: Connection reset by peer]
nickiminjaj has joined #ocaml
nickiminjaj has quit [Changing host]
nickiminjaj has joined #ocaml
nickiminjaj has quit [Quit: Textual IRC Client: www.textualapp.com]
Tuplanolla has joined #ocaml
waleee has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
trev has quit [Quit: trev]
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
patrick has quit [Killed (osmium.libera.chat (Nickname regained by services))]
patrick__ has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
trillion_exabyte has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
darchitect has quit [Quit: WeeChat 4.1.1]
rgrinberg has quit [Ping timeout: 255 seconds]
dhil has quit [Ping timeout: 268 seconds]
Serpent7776 has quit [Ping timeout: 260 seconds]
bartholin has quit [Quit: Leaving]
rgrinberg has joined #ocaml