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/
<ec> Is there any to get dune to output more helpful error messages than `Don't know how to build workspace/web.bc.js`
<discocaml> <Et7f3 (@me on reply)> What is inside workspace/dune
waleee has quit [Ping timeout: 244 seconds]
amk has quit [Ping timeout: 255 seconds]
amk has joined #ocaml
thizanne has quit [Server closed connection]
thizanne has joined #ocaml
<companion_cube> Maybe it's just .js? idk :/
bobo has quit [Quit: Konversation terminated!]
<discocaml> <darrenldl> after much wrangling, i've finally finished writing a tool for some basic checks for java assignments using javaparser package
<discocaml> <darrenldl> i have to say java is really not the best language for analysing java
chrisz has quit [Ping timeout: 245 seconds]
chrisz has joined #ocaml
azimut has joined #ocaml
<discocaml> <cdaringe> what IS it the best language for?
<discocaml> <cdaringe> NPEs. sick burn
<discocaml> <cdaringe> NPEs. sick burn (i jest, of course 😉 )
<discocaml> <darrenldl> also best for reminding yourself what is double dispatch again
hrberg_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #ocaml
bartholin has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 246 seconds]
cross has quit [Server closed connection]
cross has joined #ocaml
bartholin has quit [Quit: Leaving]
rgrinberg has joined #ocaml
dnh has joined #ocaml
Boarders___ has quit [Server closed connection]
Boarders___ has joined #ocaml
mima has joined #ocaml
Serpent7776 has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Serpent7776 has quit [Ping timeout: 246 seconds]
Leonidas has quit [Server closed connection]
Leonidas has joined #ocaml
dnh has quit [Ping timeout: 246 seconds]
myrkraverk has quit [Ping timeout: 260 seconds]
myrkraverk has joined #ocaml
Tuplanolla has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 250 seconds]
<discocaml> <lyhokia> Hello, does any one knows if there's something similar to ppx_nanocaml but maintained?
<discocaml> <sim642> Maybe I'm missing something but what's ppx_nanocaml really adding? It already uses polymorphic variants, so you might as well manage those directly and write transformations without ppx stuff
<discocaml> <sim642> Here's a very recent paper on doing something similar without ppx: https://icfp23.sigplan.org/details/ocaml-2023-papers/4/Modern-DSL-compiler-architecture-in-OCaml-our-experience-with-Catala
<discocaml> <lyhokia> How do you delete a branch from ADT?
<discocaml> <lyhokia> okay this seems interesting and it seems to be solving this problem for me
<discocaml> <lyhokia> Thanks
<discocaml> <sim642> With just polymorphic variants you can't delete branches but you can define types for common parts and then define different ASTs to combine them differently, i.e. not include all the common things
<discocaml> <sim642> With just polymorphic variants you can't delete branches but you can define types for common parts and then define different ASTs to combine them differently, i.e. not include all the things
<discocaml> <sim642> With the Catala approach, deletion is handled by those phantom object type fields
mima has quit [Ping timeout: 246 seconds]
mima has joined #ocaml
rgrinberg has joined #ocaml
pie__ has quit []
pie_ has joined #ocaml
<discocaml> <lyhokia> Is there a convenient way to copy the phantom object type and replace some field from YES to NO? I feel like this is replacing one problem to another one
waleee has joined #ocaml
reynir has quit [Ping timeout: 248 seconds]
Serpent7776 has joined #ocaml
dnh has joined #ocaml
<discocaml> <lyhokia> What does this 'as' mean here? Is there document explaining it?
daimrod1 has quit [Server closed connection]
daimrod1 has joined #ocaml
mima has quit [Ping timeout: 248 seconds]
John_Ivan has quit [Ping timeout: 246 seconds]
John_Ivan has joined #ocaml
spip has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 246 seconds]
waleee has joined #ocaml
dnh has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kurfen has quit [Quit: ZNC - https://znc.in]
kurfen has joined #ocaml
cedb has quit [Quit: WeeChat 4.0.4]
ced1 has joined #ocaml
rgrinberg has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]
uncomfy has joined #ocaml
bartholin has joined #ocaml
John_Ivan_ has joined #ocaml
John_Ivan has quit [Ping timeout: 255 seconds]
patrick has quit [Server closed connection]
patrick has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mima has joined #ocaml
ced1 is now known as cedb
mima has quit [Ping timeout: 258 seconds]
uncomfy has quit [Remote host closed the connection]
cedb has quit [Ping timeout: 255 seconds]
ced1 has joined #ocaml
sadiq_ is now known as sadiq
ced1 is now known as cedb
azimut_ has quit [Ping timeout: 246 seconds]
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
mima has joined #ocaml
azimut has joined #ocaml
leah2 has quit [Ping timeout: 245 seconds]
<discocaml> <_terence_> If you were to translate to Coq something built using this technique, would it be feasible?
ursa-major has joined #ocaml
ursa-major has quit [Max SendQ exceeded]
ursa-major has joined #ocaml
leah2 has joined #ocaml
rgrinberg has joined #ocaml
caasih has quit [Server closed connection]
caasih has joined #ocaml
waleee has joined #ocaml
Duns_Scrotus___ has quit [Server closed connection]
Duns_Scrotus___ has joined #ocaml
JSharp has quit [Server closed connection]
JSharp has joined #ocaml
<discocaml> <lyhokia> I guess as long as you have GADT and row types you can emulate this right?
<discocaml> <lyhokia> Is Coq dependenty-typed? If so it will be even easier because you can replace the object type just with a concrete value
<companion_cube> it is
<discocaml> <Kali> yes, it is
Serpent7776 has quit [Ping timeout: 246 seconds]
technomancy has joined #ocaml
mima has quit [Ping timeout: 244 seconds]
bartholin has quit [Quit: Leaving]
<technomancy> I'm teaching some teenagers ocaml and as much as I love Emacs, I don't feel like that's the right thing for them right now. are there any good newbie-friendly editors that are good for ocaml other than vs code?
<discocaml> <lyhokia> Not much... Vim?
<discocaml> <lyhokia> Does ocaml even have a recommended editor?
<discocaml> <lyhokia> Looks like you can do it online: https://try.ocamlpro.com/
<discocaml> <Kali> yes, emacs is generally recommended due to the fact is has the best support
<discocaml> <Kali> however, vim/nvim also works fine for it
<discocaml> <lyhokia> But neither emacs or vim are the choice for newbies... I would say just VSCode
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<technomancy> it looks like nano and gedit both support syntax highlighting for ocaml
<technomancy> that's handy since they already have some experience with both
<discocaml> <Kali> oh, do you just want syntax highlighting? yeah, those work fine
<technomancy> I mean... I don't know, honestly. I just want something that's not going to take a lot of time to set up and learn.
<technomancy> but for newbies maybe it's not a good idea to use a system that can't show them types in the editor?
<technomancy> how important do you think that is?
<discocaml> <lyhokia> At least LSP
<discocaml> <lyhokia> I feel Highlight + LSP + Auto complete is a must for modern work flow
<technomancy> for teaching the dynamic languages I've done, syntax highlighting has been enough, but lack of indentation support has honestly been a bigger problem than I expected
<technomancy> but I've never taught a static language before
<discocaml> <lyhokia> Sounds painful to write code on a colorful notepad
<technomancy> the assignment is a 200-line program, for context =)
<technomancy> which I wrote for myself in Emacs with no lsp or merlin or whatever
<technomancy> just colors+indentation
<discocaml> <Kali> honestly vim isn't too bad to teach if they have a cheatsheet easily accessible
<technomancy> maybe but the problem is I can't help if they get stuck, so if I'm going to recommend an "advanced" editor it will probably be emacs =)
rgrinberg has joined #ocaml
<discocaml> <lyhokia> What's preventing you from suggesting them to use VSCode?
<technomancy> neither myself nor the students like microsoft, I guess
<discocaml> <lyhokia> ... How is that a proper reason
<technomancy> I mean, they can use it if they want, and I'll mention it; I'm just wondering what the other options are.
<discocaml> <lyhokia> You guys don't use windows and office?
<technomancy> no
<discocaml> <lyhokia> If you are linux users, learning vim is a must IMO
<technomancy> I've used linux for over 20 years and never used vim
<technomancy> but I will offer it as an option
<discocaml> <lyhokia> Imagine you ssh to a server there's only vi on it, how can you survive without knowing using vim?
<discocaml> <lyhokia> If you're just a desktop user you're probably fine
<technomancy> well, lots of bad things can happen in my imagination
<discocaml> <lyhokia> I don't think there's any other practical options...
<technomancy> ok, thanks
<discocaml> <Kali> honestly just give them the options of what you've already mentioned and make note that you know emacs best
<technomancy> yeah, sounds good =)
<technomancy> https://p.hagelb.org/mire.ml.html ok, next question. this code converts to and from seqs a fair bit, to go between lists and hash tables. but I never actually want a seq for its own sake. is there a better way to do this without seqs, or is this just normal?
<technomancy> for instance, the `look` function does this twice https://p.hagelb.org/mire-look.ml.html
Exa has quit [Server closed connection]
Exa has joined #ocaml
<discocaml> <Kali> you could write your own hashtbl_of_list function
<discocaml> <Kali> shouldnt be too hard; just List.iter and add each pair as a key/value
<discocaml> <lyhokia> Guess that's just std isn't well designed...
<technomancy> but there's no built-in way to do it more gracefully then it sounds like
<discocaml> <lyhokia> Does alternate std has a better story?
<technomancy> yeah, I am considering using https://dev.realworldocaml.org/guided-tour.html as my introduction text, which uses Base
<technomancy> haven't really got a chance to explore it yet
<discocaml> <Kali> lykohia: can you imagine how many conversion functions there would be if you had a pair for every container type
<discocaml> <Kali> it would explode exponentially
<discocaml> <lyhokia> Yeah that makes sense
<discocaml> <Kali> having a single seq type between which you can convert any in two steps is reasonable
<discocaml> <lyhokia> Some of the more common structure can be introduced as a special case though.
<technomancy> do you think it's a good idea to use Base and RWO? the context is that this is a course introducing a number of different languages, taking one single program and reimplementing it over and over in several different paradigms. they'll probably spend about 3 weeks on OCaml.
<discocaml> <Kali> here's all the conversion functions in ocaml's stdlib
<discocaml> <Kali> solid line = two-way, arrow = one-way
<discocaml> <lyhokia> I'll probably not use an alternative std if you're just learning the language's syntax and semantic rather than writing real project. More stuff is always more complicated. Missing pieces in std aren't so hard to implement on your own either.
<technomancy> might be better to stick with the tutorials and documentation on ocaml.org then, huh?
<discocaml> <lyhokia> I've taken class where we write a compiler in ocaml, and we didn't end up using other std
<discocaml> <lyhokia> yeah exactly, there isn't a lot of docs on alternative std
<discocaml> <Kali> honestly, the language manual isn't that bad of a read either
<discocaml> <Kali> it's not horribly dry except in very advanced topics
<technomancy> oh wow, even the official tutorial steps you thru installing lsp
<technomancy> I guess that's becoming more common nowadays
<discocaml> <lyhokia> I like this for an intro for ocaml: https://cs3110.github.io/textbook/cover.html, they have some really advanced topic here as well like how to implement HM type inference
<discocaml> <Kali> oh wow, the ocaml site looks a little different from when i last visited
<technomancy> is merlin kind of a proto-lsp thing?
<discocaml> <Kali> merlin is an lsp
<discocaml> <lyhokia> I guess LSP protocal is proposed later than merlin
Ekho has quit [Server closed connection]
<technomancy> yeah it seems like a lot of languages have similar things
<technomancy> they realized editor independent tooling is a really good idea
<technomancy> some of them even realized that editor *and* language-independent tooling is a good idea
<technomancy> but none of them had the marketing budget that LSP had
<discocaml> <Kali> there is also ocaml-lsp
<discocaml> <Kali> > Previously, this lsp server was a part of merlin, until it was realized that the lsp protocol covers a wider scope than merlin.
<discocaml> <lyhokia> There's also nREPL for evaluation across socket, proposed by clojure.
<discocaml> <lyhokia> But never seen wide adaption beside lisp family
<technomancy> I've written an nrepl server for lua
<discocaml> <Kali> oh nice
<discocaml> <Kali> i like lua, it is a very flexible language
<technomancy> but most lua programmers don't understand what they are missing out on from not using the repl
<discocaml> <lyhokia> A lot
<discocaml> <lyhokia> Shortening the feedback loops matters a lot
<technomancy> in an alternate timeline nrepl could have been the basis for the stuff we use LSP nowadays for
<technomancy> and all that UTF-16 nonsense would not be an issue
<technomancy> ah well
<discocaml> <lyhokia> Probably not, nREPL is reponsible solely for evaluation
<technomancy> the protocol is extensible
<discocaml> <lyhokia> I love Olical's video explaining conversational development: https://www.youtube.com/watch?v=uP9iSEh7dxg
<technomancy> much moreso than LSP in fact, since it's full duplex and not limited to request/response
<discocaml> <lyhokia> that's interesting
<technomancy> but it supports documentation lookup and jump-to-definition; it's not hard to extend it to other things like types or finding references
<technomancy> the problem is that the current maintainer of nrepl.org isn't really interested in non-clojure applications of the protocol (and that lsp already dominates so strongly)
<discocaml> <lyhokia> I love Olical's video explaining conversational development: https://www.youtube.com/watch?v=ZSwbiZhvMdQ
<technomancy> I'll have to take a look
<discocaml> <Kali> lyhokia, note that editing a message resends the new message due to irc limitations
<discocaml> <lyhokia> Oh, sorry about that
<technomancy> I should have figured you folks would be sympathetic to my nrepl ideas since the original creator of nrepl uses ocaml =)
<discocaml> <Kali> it's fine, just for future reference
<discocaml> <lyhokia> does ocaml has a nrepl based on utop?
<technomancy> I haven't seen it if so but maybe cemerick has something up his sleeve
<technomancy> I also think it's pretty funny that the youtube trend of "make ridiculous faces in the thumbnail" has even spread to ocaml now https://p.hagelb.org/ocaml-yt.png
John_Ivan_ has quit [Ping timeout: 246 seconds]
energizer has quit [Server closed connection]
<discocaml> <geoff> moreso that those guys are funny face makers that have recently gotten into ocaml
<discocaml> <deepspacejohn> “Weirdest first programming language” 🤨
Ekho has joined #ocaml
energizer has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
<discocaml> <lyhokia> making funny faces get you more clicks, that's the same case for other video platforms like youtube
<technomancy> I mostly assume that anyone who knows ocaml is dignified enough to not make funny faces even if it gets more clicks
<technomancy> that may not be true but I learned from childrens' films that it's important to follow your heart
<discocaml> <regularspatula> lol what does that even mean
<technomancy> means I don't fall for clickbait =)
<discocaml> <Kali> (regularspatula was responding to deepspacejohn)
<discocaml> <Kali> replies do not bridge
<technomancy> oh haha
<discocaml> <regularspatula> Oh sorry about that I forget about the relies
<discocaml> <regularspatula> Replies*
<discocaml> <Kali> i sometimes we had a nicer non-discord bridge, like matrix or xmpp/jabber
<technomancy> bahaha this olical video has that same funny-face-making guy in the recommendations
<technomancy> apparently he hates neovim
<discocaml> <Kali> which one?
<discocaml> <Kali> the primagen?
<discocaml> <regularspatula> It’s cool to see YouTube people using ocaml
<technomancy> Kali: yeah
<discocaml> <Kali> do not be mislead by primagen's clickbait: none of those are his opinions, they are him reacting to someone expressing that opinion
<discocaml> <Kali> he uses neovim in all his videos :)
<discocaml> <Kali> or some vim flavor
<discocaml> <Kali> not sure which but i'd assume neovim
<technomancy> oh right, that other weird youtube trend of assuming people are interested in the way you react to what someone else said
Tuplanolla has quit [Quit: Leaving.]
<technomancy> recommendation algorithms are a hell of adrug
<discocaml> <Kali> almost all of primagen's videos are reaction videos
<discocaml> <Kali> there are a few that aren't
<discocaml> <Kali> but every last one is clickbait for the most part, haha
<technomancy> I should probably just get one of those extensions that hides the recommendations altogether
<technomancy> apparently 35% of the lines of my program are `let`s; if you add the lines which aren't literally `let` but still bind as part of `match`/`try`/etc it's 50%
<technomancy> is that normal?
<discocaml> <lyhokia> I think that's pretty normal
<discocaml> <Kali> seems fine
<technomancy> just takes some getting used to
<technomancy> but not as much getting used to as practically stopping using parens altogether
<discocaml> <Kali> it just means you are naming a lot of intermediate values, which is probably helpful for newer programmers
<technomancy> haha yeah don't want to get into point-free stuff yet especially