companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
hex0punk has joined #ocaml
waleee has quit [Ping timeout: 272 seconds]
drakonis has quit [Quit: WeeChat 3.1]
drakonis has joined #ocaml
Boarders has joined #ocaml
<Boarders> very dumb question: I have open Base;; at the top of my file but I get an error Unbound module Base, I have installed it with opam
<Boarders> do I need to include it in the dune file or somewhere else?
TakinOver has quit [Ping timeout: 264 seconds]
hex0punk has quit [Ping timeout: 252 seconds]
<companion_cube> yes you do, sth like `(libraries base)`
zodeishi has joined #ocaml
<Boarders> thanks!
Guest2568 has quit [Quit: Konversation terminated!]
Guest4242 has joined #ocaml
zodeishi has quit [Quit: Leaving]
<d_bot> <theangryepicbanana> I just found this in a codebase wtf
<companion_cube> is it an instance of Map.Make?
zebrag has quit [Quit: Konversation terminated!]
<d_bot> <theangryepicbanana> it's an instance of PMap.t from ptmap
<d_bot> <theangryepicbanana> which, uh, has a PMap.cardinal function...
<companion_cube> right. Surely it has a cardinal funciton
<d_bot> <theangryepicbanana> yes exactly
<companion_cube> but the cardinal function probably does exactly that
<d_bot> <theangryepicbanana> I'd guess it does it faster, but yes
<d_bot> <theangryepicbanana> either way, somebody clearly didn't care to read the docs
<companion_cube> probably not
<companion_cube> I don't think ptmap stores the size in every subtree
<d_bot> <theangryepicbanana> idk unless ocaml is really good at optimizing closures and recursive functions probably not https://github.com/backtracking/ptmap/blob/master/ptmap.ml#L141-L144
<companion_cube> ahah nope
<companion_cube> well, flambda could inline fold, I suppose
<companion_cube> the difference is probably minimal, what matters is that it's O(n) in both cases
<d_bot> <theangryepicbanana> well I'm looking at haxe's compiler so I'm guessing it'll matter at some point lol
<d_bot> <theangryepicbanana> probably just an oversight I guess, although other areas are actually bad (and I don't even use ocaml that often!)
<companion_cube> oh god they're using tabs
<d_bot> <theangryepicbanana> yes that's problem #1 of several dozen
<companion_cube> :p
<companion_cube> and objects
<companion_cube> unusual
<d_bot> <theangryepicbanana> I think it actually makes sense, since they allow for easy recursion and stuff
<d_bot> <theangryepicbanana> however, their "eval" implementation is really where the gold is
<d_bot> <theangryepicbanana> I'm working on adding some stuff to it rn, and it really makes me proud of the poor ocaml I've written in the past
<d_bot> <theangryepicbanana> anyways just thought I'd share that here, knowing y'all would appreciate it a bit lol
zodeishi has joined #ocaml
<companion_cube> hmmmmm
<companion_cube> I mean I'm amused by the tabs, but generally I'll try to not judge too harshly :3
<companion_cube> esp. since haxe has been a working project for a while, successfully afaict
<d_bot> <theangryepicbanana> yeah I try not to as well, but that in particular really just got to me
<d_bot> <theangryepicbanana> and yeah I'm sure that if they had used F# at some point, they'd have a different opinion on using tabs... ;)
<d_bot> <theangryepicbanana> actually that reminds me, do ocaml people here have any opinions on haxe? it's decently similar to ocaml
<d_bot> <theangryepicbanana> (in terms of features and spirit)
<companion_cube> I honestly have no opinion
<companion_cube> it always targetted a very different crowd, afaict
drakonis has quit [Quit: WeeChat 3.1]
<d_bot> <darrenldl> was curious about it when i wanted to get into game dev, but otherwise not overly interested
drakonis has joined #ocaml
<d_bot> <theangryepicbanana> hmm ok
<d_bot> <theangryepicbanana> was just wondering because I've chosen it to write my language's compiler in, rather than ocaml due to some of ocaml's limitations (that ppx can't fix)
<d_bot> <theangryepicbanana> it seems decently comparable to ocaml, kinda like rescript or F# vs ocaml
hex0punk has joined #ocaml
TakinOver has joined #ocaml
<companion_cube> which limitations? :)
<companion_cube> @darrenldl hey is timedesc a full alternative to calendar now?
<d_bot> <theangryepicbanana> companion_cube: primarily a lack of mutually recursive modules that keep me sane, as well as just mutually recursive file
<d_bot> <theangryepicbanana> *files
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 252 seconds]
<d_bot> <theangryepicbanana> because I'm not a huge fan of dumping everything into a single file with duplicate definitions for every module I make
<companion_cube> oh, that
<d_bot> <theangryepicbanana> yeah
<companion_cube> yeah sometimes I do have a module with all the type defs in it
<companion_cube> I don't think it's too big a deal, even if it's ugly
<companion_cube> OCaml is otherwise super robust
<d_bot> <theangryepicbanana> it is
<d_bot> <theangryepicbanana> but I consider it to be a pretty big deal when I have 20+ modules that should really be in separate files
<d_bot> <theangryepicbanana> fortunately haxe handles modules like java, so that bit has been much nicer in haxe since mutual recursion is hassle-free
<companion_cube> 🤷
<d_bot> <theangryepicbanana> (however... I would much rather be using ocaml for everything else)
<d_bot> <theangryepicbanana> I suppose the only other thing haxe has going for it is that it can print all user-defined types, rather than needing ppx or something
<companion_cube> does it use reflection for that?
<d_bot> <theangryepicbanana> usually yes
<d_bot> <theangryepicbanana> not the best thing ever, but for debugging it's nice
<companion_cube> I wonder, how's the perf?
<companion_cube> yeah I'm slowly giving up and starting to use ppx
<companion_cube> I think the design is bad, but I don't have the time to not use it anymore
<companion_cube> s/bad/not great/
<d_bot> <theangryepicbanana> it depends on the target, but I've gotten good perf using the hashlink target (although I've made some slight modifications for my version of it)
<companion_cube> what's hashlink?
hex0punk has quit [Ping timeout: 272 seconds]
<d_bot> <theangryepicbanana> it's haxe's newest target (because it can target multiple platforms) that's like a statically-typed version of their original target, neko (which is is similar to lua_
<companion_cube> so a kind of bytecode VM?
<d_bot> <theangryepicbanana> yeah basically, similar to llvm in a way
<d_bot> <theangryepicbanana> anyways for parsing and (partially) typing my language's standard library, here's the average time I've got so far:
<d_bot> <theangryepicbanana> (hopefully that image shows up on the bridge)
<companion_cube> does haxe have a nice LSP?
<companion_cube> yeah it does
<companion_cube> (the image)
<d_bot> <theangryepicbanana> companion_cube: yes the lsp is amazing, which is pretty incredible considering that it has very advanced macros (and as one may guess, lsp is still not perfect for macros)
<d_bot> <theangryepicbanana> I believe the lsp services are built into the language, so it has direct access to the compiler and stuff
<companion_cube> on paper it looks cool
<companion_cube> I'm a bit scared when I see such a long list of targets though
<companion_cube> like, how comprehensive is the C++ backend, how does the GC work, etc.
<dy> Where is d_bot linked to?
<dy> D = discord?
<companion_cube> yep
wonko has joined #ocaml
zodeishi has quit [Ping timeout: 272 seconds]
vicfred_ has joined #ocaml
vicfred has quit [Ping timeout: 264 seconds]
vicfred_ has quit [Quit: Leaving]
Haudegen has joined #ocaml
mbuf has joined #ocaml
jbrown has joined #ocaml
olle has joined #ocaml
noisy-bot has joined #ocaml
jbrown has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
dhil has joined #ocaml
<olle> Apparently, what I was looking for is called "automatic procedure extraction".
<olle> Different algorithms available, but seems academic only.
bartholin has joined #ocaml
cedric has joined #ocaml
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
noisy-bot has joined #ocaml
Nahra has joined #ocaml
Nahra has quit [Remote host closed the connection]
Nahra has joined #ocaml
<d_bot> <darrenldl> companion_cube: i'd say so - not very aware of things that calendarlib does that timedesc doesnt accomodate
<d_bot> <darrenldl> (ill have a look at calendarlib more closely shortly, but i do believe ive addressed most insufficiencies after combing through all ocaml date time libs i could get my hands on)
<d_bot> <darrenldl> well okay, there's one thing calendarlib (and various libs) allows that im still on the fence about: time zoneless date time
favonia has quit [Quit: The Lounge - https://thelounge.chat]
<d_bot> <darrenldl> ive found it useful internally in timere, but cant think of a good use case for timedesc while staying clear from undefined or unclear behaviour
<d_bot> <darrenldl> last bit: some convenient comparisons are to be added https://github.com/daypack-dev/timere/issues/28
farn has quit [*.net *.split]
waleee has joined #ocaml
mro has joined #ocaml
farn has joined #ocaml
waleee has quit [Client Quit]
waleee has joined #ocaml
farn has quit [Ping timeout: 268 seconds]
farn has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
mro_ has joined #ocaml
mro has quit [Ping timeout: 252 seconds]
mro_ has quit [Remote host closed the connection]
Tuplanolla has joined #ocaml
mro has joined #ocaml
mro has quit [Read error: Connection reset by peer]
zebrag has joined #ocaml
waleee has quit [Ping timeout: 264 seconds]
waleee has joined #ocaml
Serpent7776 has quit [Quit: leaving]
Haudegen has joined #ocaml
<companion_cube> 👍
zodeishi has joined #ocaml
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 264 seconds]
Serpent7776 has joined #ocaml
salkin has joined #ocaml
noisy-bot has quit [Ping timeout: 264 seconds]
<d_bot> <darrenldl> feel free to lmk if you want me to take a look at how to covert some uses of calendarlib to timedesc (always keen to see what UX issue i should iron out)
smondet[m] has joined #ocaml
<companion_cube> I have extremely basic use cases, tbh
<companion_cube> mostly just timestamps, for which I used to use iso8601
<d_bot> <darrenldl> ah, then Timedesc.Timestamp.of_iso8601/to_rfc3339 should work well enough for most cases with gregorian dates
<d_bot> <darrenldl>
<d_bot> <darrenldl> it does not parse iso8601 strings with no time zone designators yet, since i'm still not sure how to interpret those
<companion_cube> yeah
<companion_cube> I was also curious about the NLP part but it seems unfinished :)
<d_bot> <darrenldl> tee hee - have to upgrade timere a bit more as things turned out, still working on that
<companion_cube> what would it eventually look like? (no time pressure ofc)
<d_bot> <darrenldl> (well work's done actually, but more refactoring + fuzzing)
<d_bot> <darrenldl> let me grab an example...
<companion_cube> I tried to get stuff like "in 2 days" or "next saturday"…
<companion_cube> +working
<d_bot> <darrenldl> Timere_parse.timere_exn "8am to 12pm or 1pm to 6pm"
<d_bot> <darrenldl> "2021 aug 26th to 27th"
<d_bot> <darrenldl> and you can attach time zones to them via Timere.with_tz or in the string, e.g. "Australia/Sydney 8am to 12pm"
<d_bot> <darrenldl> coverage still improving (slowly), since getting things right even for just "HH:MM to HH:MM" was already difficult enough
<companion_cube> right
<d_bot> <darrenldl> (cause we want them to work across DST)
<companion_cube> but can "now" work? :p
<companion_cube> or "in <duration>"
<d_bot> <darrenldl> not yet added
<companion_cube> cool cool
<companion_cube> I think it's a useful feature :)
<d_bot> <darrenldl> a certain company is doing something very similar also in OCaml, granted it's strictly less powerful (afaict)
flo1 has joined #ocaml
<d_bot> <darrenldl> "I think it's a useful feature :)"
<d_bot> <darrenldl> : D - we're slowly working toward making timere(+parse) api a (very) good DSL for scheduling
<companion_cube> "every other friday" :p
<companion_cube> I'll follow with interest
<d_bot> <darrenldl> supported by timere - need to add rules to timere-parse to translate it into the right ast
wonko has quit [Quit: See You Space Cowboy..]
<companion_cube> 🎉
<d_bot> <darrenldl> Timere.chunk \`Disjoint_intervals Timere.(take_nth 1) Timere.(weekdays [\`Fri] & years [2021])
<d_bot> <darrenldl> (sorry it should be take_nth 2)
mbuf has quit [Quit: Leaving]
unyu has quit [Quit: WeeChat 3.1]
salkin has quit [Ping timeout: 264 seconds]
bartholin has quit [Remote host closed the connection]
_whitelogger has joined #ocaml
mro has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
hex0punk has joined #ocaml
favonia has joined #ocaml
favonia has quit [Client Quit]
hex0punk has quit [Ping timeout: 264 seconds]
mro has quit [Remote host closed the connection]
motherfsck has joined #ocaml
motherfsck has quit [Quit: quit]
motherfsck has joined #ocaml
motherfsck has quit [Client Quit]
motherfsck has joined #ocaml
motherfsck has quit [Changing host]
motherfsck has joined #ocaml
Haudegen has joined #ocaml
motherfsck has quit [Quit: quit]
motherfsck has joined #ocaml
berberman has quit [*.net *.split]
jbrown has quit [*.net *.split]
hexology has quit [*.net *.split]
rwmjones has quit [*.net *.split]
ebb has quit [*.net *.split]
dy has quit [*.net *.split]
Drup has quit [*.net *.split]
rwmjones_ has joined #ocaml
jbrown has joined #ocaml
Drup has joined #ocaml
hexology has joined #ocaml
ebb has joined #ocaml
berberman has joined #ocaml
salkin has joined #ocaml
salkin has quit [Ping timeout: 265 seconds]
mro has joined #ocaml
aubian2 has quit [Ping timeout: 264 seconds]
aubian2 has joined #ocaml
flo1 has left #ocaml [WeeChat 3.1]
vicfred has joined #ocaml
<d_bot> <stab> is there something i should be using instead of https://github.com/jrk/symalg for basic symbolic algebra
<d_bot> <stab> basically need to solve a linear inequality for each variable in the linear inequality
jbrown has quit [Ping timeout: 266 seconds]
jbrown has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
djellemah_ has joined #ocaml
djellemah_ has quit [Client Quit]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
vicfred has quit [Quit: Leaving]
mro has quit [Quit: Leaving...]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
olle has quit [Ping timeout: 272 seconds]
unyu has joined #ocaml
dy has joined #ocaml
mal`` has joined #ocaml
<d_bot> <theangryepicbanana> companion_cube: regarding haxe's c++ backend, it's pretty decent from what I've heard. I haven't used it myself (because I'm too lazy to install hxcpp), but like they have an entire runtime for it (+ some sort of Immix GC)
<companion_cube> oh I see
cedric has quit [Quit: Konversation terminated!]
<d_bot> <let Butanium = raise Not_found;;> ```ocaml
<d_bot> <let Butanium = raise Not_found;;> let performAction arr player = function
<d_bot> <let Butanium = raise Not_found;;> | -2 -> try (replace arr; false) with Invalid_argument _ -> failwith "replace failed"
<d_bot> <let Butanium = raise Not_found;;> | j -> try (let i = add arr player j in check arr i j player;) with Invalid_argument _ -> failwith "add/check failed"
<d_bot> <let Butanium = raise Not_found;;> ```
<d_bot> <let Butanium = raise Not_found;;> why do ocaml think that j is an exception?
<companion_cube> please use a pastebin
<d_bot> <let Butanium = raise Not_found;;> https://pastebin.com/wE1XkhJh
<d_bot> <let Butanium = raise Not_found;;> sorry I forgot it's not as good as on discord
ewanas has joined #ocaml
<d_bot> <zozozo> @Butanium the problem is the scope of the `try..with` in the first case, basically, your code is parsed as follows: https://pastebin.com/btzHw2aj
<d_bot> <zozozo> to sovle, that, you can add some `begin .. end` around the nested `try...with`
<d_bot> <let Butanium = raise Not_found;;> oh ok thanks !
Haudegen has quit [Ping timeout: 244 seconds]
ewanas has quit [Quit: Leaving]
ewanas has joined #ocaml
ewanas has quit [Client Quit]
ewanas has joined #ocaml
ewanas has quit [Client Quit]
foo303 has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
foo303 has quit [Client Quit]
yomimono has quit [Ping timeout: 252 seconds]