companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
nullcone has joined #ocaml
urek has quit [Ping timeout: 272 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
Tuplanolla has quit [Quit: Leaving.]
mxns has quit [Ping timeout: 272 seconds]
steenuil has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 272 seconds]
sagax has joined #ocaml
mxns has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
motherfsck has quit [Quit: quit]
waleee-cl has quit [Quit: Connection closed for inactivity]
oni-on-ion has joined #ocaml
reynir has quit [Remote host closed the connection]
mxns_ has joined #ocaml
cantstanya has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 272 seconds]
reynir has joined #ocaml
aaaaaa has quit [Quit: leaving]
amiloradovsky has joined #ocaml
mxns_ has quit [Ping timeout: 240 seconds]
narimiran has joined #ocaml
mbuf has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
vicfred has quit [Quit: Leaving]
shawnw has joined #ocaml
<d_bot> <ulrikstrid> Is there a ppx for logs that I am somehow not finding?
urek has joined #ocaml
steenuil has joined #ocaml
Haudegen has joined #ocaml
<d_bot> <joris> what do you expect from a log ppx ? automatic line locations?
<d_bot> <joris> or lazy evaluation for perf ?
mbuf has quit [Ping timeout: 256 seconds]
dborisog has joined #ocaml
nullcone has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
olle has joined #ocaml
urek has quit [Ping timeout: 272 seconds]
<d_bot> <hmmmmm> Hey guys, i'm pretty new to OCaml/functional programming in general but I find it really cool. I'm trying to build out a web application in OCaml that looks pretty and has some graphs. I saw that Jane Street wrote and uses something called Incr_dom to build dynamic web apps. Still kind of learning the fundamentals, but would using incr_dom & making a wrapper for a graphics library do the trick?
<d_bot> <hmmmmm> I primarily do backend development but trying to branch out a little bit and I plan on trying to do some really cool stuff with OCaml
<d_bot> <hmmmmm> Nice to meet all of you and I hope y'all have a wonderful day/night (wherever you are)!
<oni-on-ion> there is also oscigen
<d_bot> <hmmmmm> Yeah I saw ocsigen as well
<d_bot> <hmmmmm> I am trying to use a lot of Jane Street's tools for my project though
<olle> there's also reason+react
<d_bot> <hmmmmm> Wait why are you guys bots
<d_bot> <hmmmmm> Is this connected to an IRC?
<d_bot> <hmmmmm> Or.. something? 😛
<olle> you're the bot ;D
<d_bot> <hmmmmm> Dang. The tables have turned
<olle> ^^
<d_bot> <hmmmmm> I really appreciate the tech suggestions lads, but I am pretty set on OCaml + JS' libraries
<d_bot> <hmmmmm> Do y'all use them a lot or nah?
<d_bot> <hmmmmm> They open source a LOT of stuff
<d_bot> <hmmmmm> Also, apologies for me being a total noob, I just started learning this stuff a couple days ago so 😛
<d_bot> <Drup> For web stuff, I'm not sure JS libraries are very used
<Fardale> Yes, this is connected to IRC
<d_bot> <Drup> (outside of JSt, of course)
<d_bot> <hmmmmm> Unlucky for me but I'll still try and bare with it 😛
<d_bot> <hmmmmm> Also guys thanks for being so helpful it's 4:52AM for me like
<d_bot> <hmmmmm> Wasn't expecting help this quick 😛
<d_bot> <hmmmmm> Unsure how big of a learning curve there is for people who tend to do stuff with C#/Python/C++ like myself. Started learning Rust recently and that's a pretty big change
<d_bot> <hmmmmm> Hopefully I can get up and running soon
<d_bot> <hmmmmm> Just been reading the OCaml website + Real World OCaml
<olle> All our suggestions use OCaml
<olle> Ocsigen is an OCaml framework
<olle> Reason+React is OCaml with different syntax.
<olle> It's morning in Europe, and OCaml is French, so. :)
<d_bot> <hmmmmm> I'm from New York so
<d_bot> <hmmmmm> Hello!
<olle> Ah
<d_bot> <hmmmmm> Also I think i'm gonna look into Ocsigen then
urek has joined #ocaml
mfp has joined #ocaml
<d_bot> <hmmmmm> So, why do y'all love ocaml
<d_bot> <hmmmmm> What's crackin in this server
<d_bot> <hmmmmm> Lemme hear it!
<vsiles> 'cause having to deal with memory manually sucks and ocaml's GC is the best
<d_bot> <hmmmmm> Totally valid
<olle> Type safety
<d_bot> <hmmmmm> Still learning about that 😛
<d_bot> <hmmmmm> Looks like a safety designed language
<d_bot> <hmmmmm> Lots of raw speed though
<oni-on-ion> type inference and functional stuff =) also pattern matching and record updates.
<d_bot> <hmmmmm> REALLY just getting into functional stuff now, kind of regret not checking it out earlier but I had no reason to
<olle> You can get better speed if you configure the GC to eat more memory.
<d_bot> <hmmmmm> 🦀
<olle> Compare with: Java :)
<d_bot> <hmmmmm> Java code is nasty
<d_bot> <hmmmmm> I do respect JS for writing code in OCaml though
<d_bot> <hmmmmm> Most trading firm code is like disgusting java/py code
<oni-on-ion> ew cmon who mentions this awful curse words
<d_bot> <hmmmmm> come on guys dont you wanna write spring applications all day
<d_bot> <hmmmmm> also can I use base & core with ocsigen?
<oni-on-ion> and core? arent they mutually exclusive or
<oni-on-ion> if incr_dom is jane's, definately its core =)
<d_bot> <hmmmmm> Apologies, yeah, since its built on base afaik
<d_bot> <hmmmmm> Sorry it's 5:16AM lolol
<d_bot> <hmmmmm> The ocaml community is so nice wtf
<d_bot> <hmmmmm> I'm gonna finish my math HW or sleep or something but you guys r great. Toodles
<oni-on-ion> 5:18am here
<oni-on-ion> be well make sure to rest or wake up more =)
* oni-on-ion tries also
bartholin has joined #ocaml
<d_bot> <ulrikstrid> @joris mostly a slightly nicer API: `[%log "what I want to log]`
<olle> I was thinking of Java GC, not the language, btw.
<oni-on-ion> ohh. =)
<vsiles> @ulrikstrid what is wrong with `SomeLib.log "what I want to log"` ?
<d_bot> <joris> ah right, Logs lib takes a closure :/ idk i mostly use the one we use at work, from devkit, which has nice enough api without ppx (but less features)
<d_bot> <joris> Not aware of any ppx
<d_bot> <ulrikstrid> vsiles `Logs.info (fun m -> m "what I want to log")` feels like a lot of boilerplate 😄
<d_bot> <joris> i think it is partially made to make it lazy, so that evaluation of message expression are delayed after log level checking. Cannot have lazy eval and nice api without ppx indeed :/
<d_bot> <joris> it should be easy to write one though
<vsiles> I see, didn't know about this Logs lib
<d_bot> <Drup> yeah, the logs API is a little bit weird, but it's design specifically so that messages that are ignored have 0 overhead
<d_bot> <joris> (still has one closure allocation)
<d_bot> <joris> 0 overhead would be rust like ppx that translates to an if expr
<vsiles> so far I only log with some hand written code, and I've got an if somewhere in there for just that :D
<hannes> well, in the end it depends _when_ you want to choose whether or not to emit a log message.. and I'm in the dynamically-configure-this-at-runtime camp (not "let's use a preprocessor and decide at compile-time")
<vsiles> indeed
<vsiles> I don't know how to do that with a preprocessor in ocaml so I do it at runtime
<d_bot> <joris> I'm not saying ppx as check level at compile time but wrap the log body inside an if to prevent closure allocation. I mean if you are going to write a ppx you might as well do that
<hannes> joris: ah. then what's left is to analyse the performance between "conditional" and "always allocate closure"... and IIRC buenzli did that when developing the Logs library (but hey, I'm not sure, and it likely depends on your CPU and their branch prediction)
<d_bot> <dinosaure> if you want an history of that, you can check this PR: https://github.com/mirage/ocaml-git/pull/130
urek has quit [Ping timeout: 260 seconds]
narimiran has quit [Ping timeout: 260 seconds]
<theblatte> dinosaure: nice thread!
Haudegen has quit [Quit: Bin weg.]
<d_bot> <joris> @dinosaure but afaik logs goes one step further to prevent also evaluation argument, not only formatting
<d_bot> <joris> I am personally usually happy enough with only cps printf based that eagerly evaluates logging arguments
<theblatte> joris: that usually depends how disciplined people are in your codebase at not passing expensive-to-building arguments (eg printouts of huge structures passed as strings instead of %a)
<theblatte> build*
<d_bot> <joris> Right. But the api is much less verbose
<d_bot> <joris> I think if @ulrikstrid is OK with that they can add simple wrapper on top of logs to do that without the need of ppx
<d_bot> <ulrikstrid> Might be a fun exercise to get my hands dirty with ppx writing. Just do the simplest/stupidest ppx that removes the boilerplate
<d_bot> <dinosaure> yes 🙂 it's just a nice topic to re-contextualize `logs`
<d_bot> <Drup> In some way, it's a disapointing conclusion: the `i*printf` family of function is ... slow.
<theblatte> Drup: yes, it makes me think (again) that I should migrate our codebase to use something like Log instead of our current logging based on i*printf
<theblatte> although I don't remember logging ever showing up in profiling
<theblatte> but maybe it can still put undue pressure on the GC
<d_bot> <Drup> (and the only reason why it's slow is that we walk through the format string to prove the typechecker we are ignoring the right number of arguments ....)
urek has joined #ocaml
<theblatte> maybe things were better when Format was just some magic builtin functions :p
nullcone has quit [Quit: Connection closed for inactivity]
Haudegen has joined #ocaml
shawnw has quit [Remote host closed the connection]
shawnw has joined #ocaml
<d_bot> <tatchi> @ulrikstrid Although it's for ReScript, you could probably take some inspiration from: https://github.com/MinimaHQ/rescript-logger
<d_bot> <ulrikstrid> Thanks @tatchi that might be a good inspiration for the ppx yes 🙂
narimiran has joined #ocaml
<d_bot> <Drup> That opium release is very impressive, it looks pretty nice and modular
vicfred has joined #ocaml
<d_bot> <Anurag> @tmattio Has done a really great job with this new release 🙂
<d_bot> <Drup> I was surprised to see tyxml hardcoded for html/svg/xml, but I won't complain :3
waleee-cl has joined #ocaml
<d_bot> <Anurag> We wanted to have defaults that are good for the common usecases 🙂
urek has quit [Ping timeout: 272 seconds]
urek has joined #ocaml
<d_bot> <Drup> Did you tried to do better than printing to a string and then outputing that ?
urek__ has joined #ocaml
urek has quit [Ping timeout: 272 seconds]
<d_bot> <Anurag> I didn't work on this part specifically. But i think we can do better by using the `Lwt_fmt` module to avoid creating the full string before responding.
<d_bot> <Drup> (I remember talking about that to someone, don't remember who)
<d_bot> <Anurag> it was me 🙂
<d_bot> <Anurag> Last time i tried it I was able to get something working, but I found the `Lwt_fmt.make_stream` didn't provide access to the push function so it was awkward to indicate when the stream is "done".
<d_bot> <Drup> ah, yes
<d_bot> <Anurag> I have been using Lwt more than async nowadays, so if there are improvements that can be made to the Lwt_fmt module i'll be happy to learn and work on patches.
<d_bot> <Drup> yeah, it shouldn't be so hard to add the necessary machinery to be able to close the stream
<d_bot> <Anurag> I think another thing I wanted to consider was having something that will also work under mirage. `Lwt_fmt` is only available under `lwt.unix` so that won'
nullcone has joined #ocaml
<d_bot> <Drup> yeaah, that because we never tried very hard to make it unix-independent
<d_bot> <Drup> (for stupid reasons)
motherfsck has joined #ocaml
motherfsck has quit [Client Quit]
<d_bot> <Drup> (basically, because we wanted `Lwt_fmt.stdout` in the module)
motherfsck has joined #ocaml
<d_bot> <Drup> Maybe it's the right time to make this kind of changes, with the luv shuffle going on
urek__ has quit [Ping timeout: 272 seconds]
urek has joined #ocaml
<d_bot> <Anurag> Hmm it looked like the initial goal is to just have `luv` as an engine, so it'd probably be a while before a breaking change like this is considered as a candidate for merge?
hnOsmium0001 has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
shawnw has quit [Ping timeout: 264 seconds]
Tuplanolla has joined #ocaml
<d_bot> <dinosaure> I just would like to notice that if you come with `lwt.unix`, you can not use it with MirageOS anymore 🙂
olle has quit [Ping timeout: 264 seconds]
<d_bot> <Anurag> I think the parts of `Lwt_fmt` that would be helpful for the tyxml integration are not dependent on unix. But unfortunately the rest of the Lwt_fmt module will pull in Lwt_io for lwt_channel support..
<d_bot> <Drup> arguably, that part should be in Lwt_io (and half of Lwt_io should go away :p)
Haudegen has quit [Quit: Bin weg.]
bartholin has quit [Quit: Leaving]
dhil has joined #ocaml
dborisog has quit [Ping timeout: 272 seconds]
vicfred has quit [Quit: Leaving]
Haudegen has joined #ocaml
nullcone has quit []
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
urek has quit [Ping timeout: 256 seconds]
urek has joined #ocaml
urek has quit [Remote host closed the connection]
urek has joined #ocaml
urek has quit [Ping timeout: 272 seconds]
urek has joined #ocaml
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 260 seconds]
gareppa has joined #ocaml
urek__ has joined #ocaml
urek has quit [Ping timeout: 272 seconds]
gareppa has quit [Remote host closed the connection]
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
steenuil has quit [Ping timeout: 240 seconds]
urek__ has quit [Ping timeout: 264 seconds]
urek has joined #ocaml
<d_bot> <tjammer> Can anyone help me understand the differences between opam-publish and dune-release? It seems to me that they do more or less the same thing
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
<d_bot> <mseri> They have the same purpose but have different assumptions on your project and are more or less opinionated
vicfred has joined #ocaml
<d_bot> <mseri> For example dune-release assumes that you use dune and that you keep a changelog, and takes care to tag the repo, upload documentation and release archive the for you, after checking it with linters and running tests
<d_bot> <mseri> Opam-publish expects you to have tagged the repo and published the artifacts instead, just taking care of making the opam-repository PR
<d_bot> <Drup> (also, dune-release uses opam publish)
vicfred has quit [Quit: Leaving]
<d_bot> <rgrinberg> @Drup no it doesn't
<d_bot> <Drup> really ? I was somehow convinced it did, at least initially
<d_bot> <rgrinberg> dune-release is actually based off old topkg code
<d_bot> <tjammer> The dune manual recommends using dune-release (for dune projects obviously), is this opinion shared by the community? When I googled how to publish to opam, I found this site https://opam.ocaml.org/doc/Packaging.html and used opam-publish instead
<companion_cube> Personally I don't like dune-release
<companion_cube> But I'm an old fart
<d_bot> <Drup> @tjammer yeah, just use dune-release
dan64- has joined #ocaml
dan64 has quit [Ping timeout: 265 seconds]
<companion_cube> in theory opam-publish is still supported
<companion_cube> but github is deprecating the API used or whatever :(((
<neiluj> hi!
<neiluj> is there a nice library for developping a webserver?
<neiluj> a front-end for a vcs
<companion_cube> look at opium
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
urek has quit [Ping timeout: 272 seconds]
narimiran has quit [Ping timeout: 256 seconds]
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
<neiluj> thanks companion_cube
<neiluj> i'll smoke some ^^
steenuil has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
vicfred has quit [Quit: Leaving]
reynir has joined #ocaml
vesper11 has quit [K-Lined]
amiloradovsky has joined #ocaml
urek has joined #ocaml
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
reynir has quit [Remote host closed the connection]
reynir has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
vicfred_ has joined #ocaml
vicfred has quit [Ping timeout: 265 seconds]
vicfred has joined #ocaml
vicfred_ has quit [Ping timeout: 256 seconds]
vicfred has quit [Client Quit]
neiluj has quit [Ping timeout: 272 seconds]
neiluj has joined #ocaml
vicfred has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
dhil has quit [Ping timeout: 256 seconds]
<d_bot> <Eric J Morey> I've been looking for a site or something I can self host which allows for collaborative text editing with OCaml syntax highlighting. There seem to be may sites that allow for collaborative text editing but have no support for OCaml.
<d_bot> <theangryepicbanana> repl.it supports ocaml, but it's not publicly listed (still accessible though) because the default "run" command is broken. I can step you through how to fix it if you're interested
<d_bot> <Eric J Morey> I would be, yes.
<d_bot> <theangryepicbanana> cool then
<d_bot> <theangryepicbanana> 1) go to https://repl.it/languages/ocaml (note: you'll probably need to make an account at some point due to recent policy changes. shouldn't be an issue)
<d_bot> <theangryepicbanana> 2) add a file called `.replit` (in the file tree)
<d_bot> <theangryepicbanana> 3) add this to the `.replit` file: ```toml
<d_bot> <theangryepicbanana> language = "ocaml"
<d_bot> <theangryepicbanana> run = "<command goes here>"``` (replace `<...>` obviously)
<d_bot> <theangryepicbanana> 4) that should work I think
<d_bot> <theangryepicbanana> I don't remember what version of ocaml/opam we have atm, but it shouldn't be all that ancient I don't think
<d_bot> <theangryepicbanana> let me know if you need more help with that
<d_bot> <theangryepicbanana> oh I think it also comes with lsp
<d_bot> <Eric J Morey> Thanks! I'll give it a try tonight
<d_bot> <theangryepicbanana> 👍
bjorkintosh has quit [Read error: Connection reset by peer]
bjorkint0sh has joined #ocaml
stux|RC-only has quit [Ping timeout: 260 seconds]
stux|RC-only has joined #ocaml