adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
shinnya has quit [Ping timeout: 240 seconds]
isd has quit [Quit: Leaving.]
pierpal has joined #ocaml
FreeBirdLjj has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
pierpa has joined #ocaml
silver has quit [Read error: Connection reset by peer]
cbot_ has joined #ocaml
cbot has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Ping timeout: 255 seconds]
ziyourenxiang has quit [Ping timeout: 250 seconds]
mfp has quit [Ping timeout: 246 seconds]
sh0t has quit [Remote host closed the connection]
ygrek has joined #ocaml
navaja has joined #ocaml
hdon has quit [Ping timeout: 246 seconds]
navaja has quit [Read error: Connection reset by peer]
struktured has joined #ocaml
cbot_ has quit [Ping timeout: 250 seconds]
ygrek has quit [Ping timeout: 260 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
ctrlsbstr has joined #ocaml
ctrlsbstr has quit [Client Quit]
jao has quit [Ping timeout: 246 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Ping timeout: 250 seconds]
jbrown has quit [Ping timeout: 250 seconds]
cbot_ has joined #ocaml
jerith has quit [Remote host closed the connection]
yomimono_ has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
pierpa has quit [Quit: Page closed]
pierpal has joined #ocaml
hdon has joined #ocaml
j0sh has quit [Ping timeout: 260 seconds]
j0sh has joined #ocaml
FreeBirdLjj has joined #ocaml
pierpal has quit [Ping timeout: 250 seconds]
cbot_ has quit [Ping timeout: 260 seconds]
pierpal has joined #ocaml
cbot has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
sveit has quit [Ping timeout: 246 seconds]
sveit has joined #ocaml
sveit has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Ping timeout: 255 seconds]
moolc has joined #ocaml
sveit has joined #ocaml
cobreadmonster has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
hdon has quit [Changing host]
hdon has joined #ocaml
<hdon> hi all :) i'm reading the Hashtbl docs. i see that Make allows me to obtain a Hashtbl typed to my key type. but what about my value type?
nicoo has quit [Read error: Connection reset by peer]
nicoo has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 250 seconds]
fredcy has quit [Quit: ZNC - http://znc.in]
spew has quit [Quit: Connection closed for inactivity]
tizoc has quit [Quit: Coyote finally caught me]
malina has joined #ocaml
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wagle has joined #ocaml
fredcy has joined #ocaml
govg has joined #ocaml
muelleme has joined #ocaml
<moolc> hdon: can you expand the question, i don't quite understand what is that you are asking (nor why would you need this)
hdon has quit [Ping timeout: 250 seconds]
<moolc> right
sveit has quit [Ping timeout: 250 seconds]
<mrvn> aparently he doesn't want help
hdon has joined #ocaml
<moolc> hdon: can you expand the question, i don't quite understand what is that you are asking (nor why would you need this)
<moolc> mrvn: let's test this theory
sveit has joined #ocaml
wagle_ has joined #ocaml
wagle has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
wagle_ has quit [Client Quit]
sveit has quit [Ping timeout: 256 seconds]
wagle has joined #ocaml
hdurer[m] has quit [*.net *.split]
spectrumgomas[m] has quit [*.net *.split]
bglm[m] has quit [*.net *.split]
Walter[m] has quit [*.net *.split]
flux[m] has quit [*.net *.split]
hcarty[m] has quit [*.net *.split]
orbifx[m] has quit [*.net *.split]
groovy2shoes has quit [Ping timeout: 265 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
muelleme has quit [Ping timeout: 264 seconds]
groovy2shoes has joined #ocaml
sveit has joined #ocaml
sveit has quit [Ping timeout: 250 seconds]
cschneid has quit [Ping timeout: 260 seconds]
pierpal has joined #ocaml
<moolc> mrvn: i'd say your assertion was right on the money
sveit has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
hdon has quit [Changing host]
hdon has joined #ocaml
<hdon> moolc: Hashtbl is a key-value store. with Hashtbl.Make i can specify the key type, but i did not know how to specify the value type. when i use Hashtbl.Make(Hashtbl.HashedType).add(), though, apparently this is enough for ocaml to infer the value type. i found this quite surprising.
<moolc> hdon: part of my question was - why do you need to restrict it on the value basis?
<hdon> moolc: coming from other statically typed languages like C++ and D, it's my habit to want to fully determine a type "before" instantiating it. so, i expected Hashtbl.Make to determine the key type and the value type!
<mrvn> hdon: The Hashtable never does anything with the value but store it. It works with any value. But once you use a certain value ocaml can infer the type for that hashtable.
<mrvn> hdon: think: template<T> Hastable <>
cschneid has joined #ocaml
<mrvn> hdon: The only reason for the functor is to tell ocaml about the compare function. The type of the key doesn't have to be specific in that.
<moolc> hdon: your structure produced by a functor would be sealed after first use, so no chance of (major) SNAFU.. and little need to play with value type.. but i'm sure lot's of folk here can do that
<hdon> mrvn: but HashedType also has the .t field which tells the key type
<hdon> though IIUC, you're saying that Hashtbl doesn't care about HashedType.t so much. it treats it as opaque
<mrvn> hdon: yes. Your module can have type t = 'a
<hdon> i guess it doesn't need to know about the value type either. but, then, what is the type of my hash table instance? surely if i want to export it from my module for another consumer, they will need to know the value type. how will i describe it to them?
<mrvn> hdon: The functor has a type M -> S. And S has a hashtable type you use.
<hdon> so, Hashtbl.Make(MyHashedType).S is the type?
<mrvn> module H = Hashtbl.Make(MyHashedType) and then H.t or H.hashtbl or something.
<mrvn> since the value is unspecified there should be an 'a in there too. check the API docs.
<hdon> H.t would be my expectation... but from H.t i don't see how the value type is determined... the type inference may be more powerful than my brain
<mrvn> I would expect something like (MyHashedType.t, 'a) H.t
<hdon> ahhh
<hdon> maybe i should look for the Hashtbl source code
<mrvn> hdon: just try Hashtbl.Make(MyHashedType) in the toplevel and see what type comes ouzt
<mrvn> 'a S.t it seems. No polymorphism in the key left.
<mrvn> On another note: The generated docs have some "Since 4.03.0" lines in it. Is there any way to generate web pages where you can select a version at the top and then it hides those entries that don't apply?
<hdon> that would be a nice feature
<moolc> hdon: ask for it on mantis
<hdon> if it simply redirected you to a separate copy of the docs for another version, though, that would also solve the issue of any backward-compatibilty-breaking changes
<hdon> moolc: what's mantis?
* hdon clicks
* moolc once again prepares to type goatse du jour
<hdon> written in PHP :(
<moolc> so is mediawiki?
<hdon> yes but i hoped it was written in ocaml :)
pierpal has quit [Read error: Connection reset by peer]
<moolc> hdon: ocaml is completely unsuitable for this!
<moolc> ocaml and bugs... do not mix
<hdon> what do you mean?
<moolc> attempted humor
<hdon> :
<hdon> :3
<mrvn> ocaml code has no bus, if it compiles, it runs. :)
<hdon> heh
<moolc> it does not have a bus that much is true
<moolc> insects though.. different matter altogether
<hdon> i'm concerned that ocaml has exceptions but what exceptions can be thrown from a function are not part of the function's type. in java, they are, so the compiler can know if you handle all exception types. ocaml seems to excel at making sure all cases are handled, so why this hole?
<moolc> hdon: volumes has been written on the subject of checked exceptions, they are no panacea... but yeah inability to tell at a glance whether things are safe to call is a nuisance
<hdon> mmm...
<mrvn> hdon: you can always restrict yourself to use thge *_opt functions.
<moolc> mrvn: thing that require discipline are bound to fail... eventually
<mrvn> true.
<mrvn> Some libraries have a exception and option flavour so you make sure to use the right functions by selecting the right module.
<moolc> someone should pick up ocamlexc but... i guess if it didn't happen in the last 15 years chances are rather slim
<moolc> and Oleg Kiselyov misused them to provide delimcc goodness
<moolc> oh well
<mrvn> It's odd that exception got merged into "match" but not into the types.
<moolc> the merging into match is a godsend though
cobreadmonster has quit [Quit: Connection closed for inactivity]
<mrvn> it's nice to use but can be hard to read with custom exceptions.
jerith has joined #ocaml
dhil has joined #ocaml
barcabuona has quit [Quit: WeeChat 2.1]
cbot has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
ctrlsbstr has joined #ocaml
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 260 seconds]
argent_smith has joined #ocaml
TarVanimelde has joined #ocaml
orbifx[m] has joined #ocaml
hcarty[m] has joined #ocaml
flux[m] has joined #ocaml
flux[m] has quit [Ping timeout: 240 seconds]
orbifx[m] has quit [Ping timeout: 240 seconds]
dlebrecht[m] has quit [Ping timeout: 260 seconds]
neiluj has quit [Ping timeout: 260 seconds]
caseypme[m] has quit [Ping timeout: 260 seconds]
copy` has quit [Ping timeout: 255 seconds]
remix2000[m] has quit [Ping timeout: 255 seconds]
M-martinklepsch has quit [Ping timeout: 255 seconds]
equalunique[m] has quit [Ping timeout: 255 seconds]
RouvenAssouly[m] has quit [Ping timeout: 240 seconds]
pmetzger[m] has quit [Ping timeout: 240 seconds]
tiksin[m] has quit [Ping timeout: 240 seconds]
talyian[m] has quit [Ping timeout: 240 seconds]
Bozghurt[m] has quit [Ping timeout: 240 seconds]
loxs[m] has quit [Ping timeout: 240 seconds]
ansiwen has quit [Ping timeout: 240 seconds]
hcarty[m] has quit [Ping timeout: 240 seconds]
smondet[m] has quit [Ping timeout: 250 seconds]
M-jimt has quit [Ping timeout: 250 seconds]
srenatus has quit [Ping timeout: 269 seconds]
Haudegen has joined #ocaml
clog has quit [Ping timeout: 260 seconds]
cheesy has quit [Quit: Connection closed for inactivity]
isaachodes[m] has quit [Ping timeout: 255 seconds]
neatonk[m] has quit [Ping timeout: 255 seconds]
olopierpa[m] has quit [Ping timeout: 256 seconds]
bli[m] has quit [Ping timeout: 256 seconds]
mmmmmmmmmmmm[m] has quit [Ping timeout: 256 seconds]
Bluddy[m] has quit [Ping timeout: 256 seconds]
yetanotherion[m] has quit [Ping timeout: 260 seconds]
Haudegen[m] has quit [Ping timeout: 260 seconds]
drsmkl[m] has quit [Ping timeout: 260 seconds]
rgr[m] has quit [Ping timeout: 260 seconds]
regnat[m] has quit [Ping timeout: 276 seconds]
multiocracy[m] has quit [Ping timeout: 276 seconds]
peddie[m] has quit [Ping timeout: 276 seconds]
aspiwack[m] has quit [Ping timeout: 276 seconds]
bramford has joined #ocaml
moolc has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
zolk3ri has joined #ocaml
jnavila has joined #ocaml
pierpal has joined #ocaml
tarptaeya has joined #ocaml
mfp has joined #ocaml
<steenuil> is there a particular reason why all the Makefiles have old-style implicit rules and lots of sequencing through &&?
<steenuil> I'm kinda stuck with hevea but I thought it'd be helpful to clean up the build process a bit
<mrvn> "all the Makefiles"?
<steenuil> oh yeah, I should've specified
<mrvn> you need && when you use a shell variable
<steenuil> in the ocaml repo, the Makefiles for the manual
<steenuil> it's to generate the "Failure when generating {file}" error message, but is that really needed?
<steenuil> and I was wondering whether supporting very old versions of gmake by not using new features was a concern
<mrvn> It's so that it doesn't abort half way through $(TEXQUOTE) leaving a borken file in place
<mrvn> Doesn't GNU make remove the target file if it didn't exist before and the target fails?
<steenuil> but it doesn't edit files in place
<mrvn> steenuil: >... creates the file on start and then appends to it.
<steenuil> and nope, it only removes intermediate files when the command succeeds
<steenuil> when it fails it should keep them
<mrvn> anyway, other than the error message it should just work without &&
<mrvn> would just leave the temp file
<steenuil> https://gist.github.com/steinuil/28745e30898d6a2adf876c798da1a7f6 if you do it like this it doesn't
<steenuil> because it automatically removes the .gen.tex files when all the targets are done
<mrvn> true. Although I kind of wish make had an option to turn that off. Disk space is usualy cheap and sometimes I want to look at the intermediaries.
jnavila has quit [Ping timeout: 240 seconds]
<steenuil> yeah, I was kind of surprised yesterday when it happened
reynir has quit [Ping timeout: 268 seconds]
<_xvilka_> Why OCaml not yet added "unwrap_or()" function like in Rust, for shorter handling Some -> .. | None -> default_val cases?
<steenuil> _xvilka_: I wrote an option module with a similar function hoping to include it in the stdlib
<steenuil> (though I haven't finished the documentation yet)
<_xvilka_> steenuil: cool, that would be awesome
<_xvilka_> steenuil: do you have a link?
<steenuil> I'll make a gist
<zolk3ri> ah fuck, the unwrap madness will get into ocaml, too?
<zolk3ri> great
<mrvn> couldn't one do something like the default args for functions. Maybe "match ~(foo:42) with x -> x + 1"
TarVanimelde has quit [Quit: TarVanimelde]
<mrvn> let ~(bla=def) = Hashtable.find_opt items key
<mrvn> steenuil: In your Makefile if TEXQUOTE fails it leaves the file behind. When you run it again will it then say the file is already build?
<steenuil> ah, right
<mrvn> I think the "&& mv ..." is needed. The rest not
reynir has joined #ocaml
ansiwen has joined #ocaml
multiocracy[m] has joined #ocaml
neiluj has joined #ocaml
RouvenAssouly[m] has joined #ocaml
spectrumgomas[m] has joined #ocaml
bglm[m] has joined #ocaml
rgr[m] has joined #ocaml
aspiwack[m] has joined #ocaml
drsmkl[m] has joined #ocaml
equalunique[m] has joined #ocaml
copy` has joined #ocaml
smondet[m] has joined #ocaml
remix2000[m] has joined #ocaml
M-jimt has joined #ocaml
peddie[m] has joined #ocaml
srenatus has joined #ocaml
M-martinklepsch has joined #ocaml
caseypme[m] has joined #ocaml
hdurer[m] has joined #ocaml
tiksin[m] has joined #ocaml
talyian[m] has joined #ocaml
orbifx[m] has joined #ocaml
olopierpa[m] has joined #ocaml
Haudegen[m] has joined #ocaml
hcarty[m] has joined #ocaml
pmetzger[m] has joined #ocaml
regnat[m] has joined #ocaml
neatonk[m] has joined #ocaml
Bluddy[m] has joined #ocaml
isaachodes[m] has joined #ocaml
Bozghurt[m] has joined #ocaml
mmmmmmmmmmmm[m] has joined #ocaml
loxs[m] has joined #ocaml
Walter[m] has joined #ocaml
yetanotherion[m] has joined #ocaml
dlebrecht[m] has joined #ocaml
flux[m] has joined #ocaml
bli[m] has joined #ocaml
ziyourenxiang has joined #ocaml
ioanluca has joined #ocaml
dario9 has joined #ocaml
<dario9> Some of you may find this useful and/or amusing: https://github.com/darioteixeira/passmaker
<dario9> (It should hit the opams soon...)
<discord2> <ncthbrt> Drup: Thanks for your blogpost on GADTs. Given me an idea on how to simply some of my code
jao has joined #ocaml
pierpal has quit [Ping timeout: 255 seconds]
tarptaeya has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
pierpal has joined #ocaml
kakadu has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
<hdon> hi :) is there a universal way to obtain a string representation of exceptions?
<hdon> or a tool to tell me what exceptions might be thrown from a given expression?
clog has joined #ocaml
<zolk3ri> Q: The generated passphrase was offensive! What's up with that?
<zolk3ri> A: Some care was taken to remove potentially offensive words from the word lists. However, given that upwards of 16 quintillion passphrases may be generated, there are bound to be some that someone, somewhere, will find offensive. Should that be you, just chill and generate a new passphrase.
<zolk3ri> I found this one funny. :P
<dario9> Thanks, ‎zolk3ri‎! ;-)
<dario9> hdon: Checkout stdlib's Printexc module. In particular function 'Printexc.to_string'.
<hdon> thanks dario9 :)
<_xvilka_> hdon: also kind of similar thing is using Or_error
jnavila has quit [Ping timeout: 256 seconds]
<Drup> steenuil: if you want your porposal to suceed, I suggest you start with the subset of operations that is more or less common to containers, batteries and core :p
<Drup> also, add 'a t, equal, compare, ...
<Drup> ncthbrt: Thanks! What are you cooking with it ? :)
<steenuil> yeah, I wanted to split it into the stuff that was more or less agreed upon and the stuff that wasn't
<Drup> also, your "apply" is usually "iter"
<steenuil> yeah, but it just didn't seem like a very good name to me. Though I guess apply isn't any better
<steenuil> octachron: can I just delete the tools for the manual that aren't used anymore?
<Drup> it's standard, it doesn't matter much if it's a good name or not
<steenuil> ok, I wasn't sure about the name anyway
<flux[m]> what is a decent OCaml server/server library for providing a REST api and comet-like (ie. websocket) stream of events to a HTTP client (probably built on React)?
<discord2> <ncthbrt> Drup: Http request router
<flux[m]> I guess I'm going to look into opium. tried ocsigen sufficiently many times :). these are probably the only two options anyway.
<discord2> <ncthbrt> Opium looks quite cool. Does it support websockets out the box?
<discord2> <ncthbrt> I suppose a better question is whether cohttp supports it (as that is what opium is based on)
<flux[m]> maybe not, but I don't know how much the websocket package provides, so the bridge to gap could be pretty small
<discord2> <ncthbrt> Do you need both rest and sockets? Why not simply choose one or the other?
<flux[m]> I'm assuming it doesn't support it, because it doesn't depend on the websocket package :)
<flux[m]> I like the API to be functional with simple clients
<flux[m]> websockets would be used for asynchronous updates
<discord2> <ncthbrt> Ohh. Will check those out thanks drup
<discord2> <ncthbrt> flux[m]: Fair enough. We have to support both for other reasons, but if I had the choice, I would personally adopt message driven architecture through sockets. Makes things simpler (no need to worry about being RESTful or trying to unify an event driven architecture with a document oriented one)
<Drup> I'm not sure how solid ocaml-websocket is
<discord2> <Perry> steenuil: you should put your Option module in a real repo so others can send you pull requests 😃
<Drup> Perry: you mean, like ocaml/ocaml ? :D
<discord2> <Perry> That would be when it is slightly more baked, but yes. 😃
<Drup> well then, steenuil/ocaml :)
<discord2> <ncthbrt> Drup: furl seems quite close to what I want. Though don't think I'd be able to necessarily use it directly. Definitely will give the source a read
<Drup> furl is pretty alpha
<Drup> because of the value restriction, I can't make the API I want
<steenuil> I just uploaded it there momentarily, but yeah, that was the plan
<Drup> ncthbrt: tyre, which furl uses, is quite usable though, and you should be able to rely on it for the matching part
<discord2> <ncthbrt> Drup: I've put something together which uses ppxes. Code behind is a bit ugly though
<Armael> I'm a big fan of batteries' (|?) operator (where (Some x) |? y = x and None |? y = y)
<Armael> it could be added to the option module
<discord2> <ncthbrt> Will check out tyre
<Drup> ncthbrt: Yes, I have considered this. What format do you use for the url routes ? there is an RFC for "uri templates" but it's ... annoying
<discord2> <ncthbrt> Here's an example. https://github.com/ncthbrt/reconstruct/blob/master/test/ppx/TestPpx.re#L18 Pre alpha level stuff.
<Drup> that doesn't look very good :D
<flux[m]> hmm, jbuilder manual says how I can use (env..) to set compilation flags, yet when I run jbuilder build it complains "Unknown constructor env"?-o
<discord2> <ncthbrt> Sorry for reason syntax. In what way? Asking because nothing is really set in stone. Have been trying to figure out other aspects of the framework first. Started off with the ppx because that was the main thing I didn't know how to do
<Drup> I think it really need delimiters
ncthbrt has joined #ocaml
<Drup> so, { } around the thing that you are interested in matching
<Drup> If you add delimiters, the name of the match grouped become clearer, so you can get read of the second part of the "pattern" where you list the names
<Drup> "/bar/{name:string}/foo/{surname:string}" -> ...
<Drup> I would probably go a bit further et do something like `function%route Get "some/url/{x:int}" -> .... | Post "...." -> ... | ...`
<Drup> and*
<ncthbrt> This is a fair point, if it'll help to make things clearer: "/bar/{name:string}/foo/{surname:string}"
<ncthbrt> What do you mean by: `function%route Get "some/url/{x:int}" -> .... | Post "...." -> ... | ...` ?
<ncthbrt> Are you suggesting that this ppx rewrites to a match statement?
jnavila has joined #ocaml
<Armael> function%route looks nice
<Drup> ncthbrt: yes
<ncthbrt> That's an interesting idea. Will have to think about it a little to see if I can make it work in the context of the larger framework.
<ncthbrt> Trying to make an ocaml version of https://suave.io/
spew has joined #ocaml
<ncthbrt> Which takes a combinatorial approach to composing web apps
<ncthbrt> I suspect your design could very well work. Just need to think *how*
<Drup> ncthbrt: did you wrote the parser for the "url pattern" already ?
<ncthbrt> Yes
<Drup> that's one of the thing that I couldn't be bothered to write for furl :D
<ncthbrt> It's quite a simple one: only supports constants, matches and wildcards
dario9 has quit [Quit: Konversation terminated!]
<Drup> Yeah, that's my issue, I was going to write a full uri template parser according to the spec : https://tools.ietf.org/html/rfc6570
<Drup> I don't even think it's that much work ...
<ncthbrt> (Also supports query strings)
<ncthbrt> I haven't heard of this rfc before.
hdon has quit [Ping timeout: 240 seconds]
<Drup> yeah, it's not well known, it's used by some routing libraries
<Drup> honestely, the semantics they describe is garbage
<Drup> but the syntax is decent
<octachron> steenuil, deleting unused tools sounds like a good idea to me.
hdon has joined #ocaml
shinnya has joined #ocaml
<ncthbrt> I was thinking that in terms of validation in capture groups, could just pass in a function from: string -> 'a and if it throws, the group doesn't match
<Drup> meh
<Drup> just use Tyre, it's better :D
<Drup> it'll give you linear time matching on arbitrary number of routes
<ncthbrt> How hard do you think it would be to make it be able to compile to the bucklescript backend?
<Drup> and validation for arbitrarely complex datatypes
<Drup> Tyre ? It's pure ocaml
<Drup> it works fine in jsoo
<Drup> I can't say more than that
<ncthbrt> Ok. That's a good sign. Does it make heavy use of the `Str` module?
<Drup> No, it uses "re"
_andre has joined #ocaml
hdon has quit [Ping timeout: 265 seconds]
jbrown has joined #ocaml
hdon has joined #ocaml
sh0t has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
<ncthbrt> This may be an unpopular opinion, but I kind of feel that regular expressions are overkill for most http routing requirements. If you treat everything between `/` as an atom, you also get linear time matching.
pierpal has quit [Read error: Connection reset by peer]
silver has joined #ocaml
hdon has joined #ocaml
<Drup> sure you do, but you are basically reimplementing a regular expression engine
<Drup> especially if you want regex in the atoms
<Drup> might as well used a well optimized one that is going to match everything in one go
<ncthbrt> You are, but one that has the advantage of a) being aware of the context in which it is being used, allowing for optimisations across routes and b) being much simpler.
pierpal has joined #ocaml
<Drup> It's new code, it's never simple than using code that already works
<Drup> simpler*
<ncthbrt> Unfortunately it's also code that I'd also have to port. :/
hdon has quit [Ping timeout: 240 seconds]
<ncthbrt> (Unless your referring to a different Re https://github.com/ocaml/ocaml-re)
<Drup> I want to laught at the fact that you have to port pure ocaml things to be usable by bucklescript, but it's actually really super sad :/
<ncthbrt> Perhaps I'll be lucky and they're not using features introduced in latest ocaml versions (That's the main problem, bucklescript's stdlib is pretty behind)
<ncthbrt> Agree that it is sad
hdon has joined #ocaml
<ncthbrt> But hey progress is managing to convince company to start moving from nodejs to strongly typed functional langauge :)
<Drup> fair enough :)
<ncthbrt> Wouldn't have managed that without bucklescript and reason
<ncthbrt> If I can get this dual compilation right, will probably be even able to start to move some µ-services to native ocaml
<ncthbrt> And not have to write another manual JSON decoder.
<discord2> <Perry> Do we have a good enough library of tools for building microservices in OCaml?
hdon has quit [Ping timeout: 240 seconds]
<Drup> Perry: You don't know about mirage ? :)
dhil has quit [Ping timeout: 240 seconds]
<discord2> <Perry> I know about mirage because I know a lot about the thing that spawned it (Pooka's Unikernel work in NetBSD.)
sh0t has quit [Remote host closed the connection]
<discord2> <Perry> But I thought Mirage was an OCaml unikernel system, not a microservice toolkit.
<Drup> fair enough. It kind of go together for me, but well
<ncthbrt> A unikernal sounds like a microservice that has found buddha
<Drup> that's pretty acurate
tizoc has joined #ocaml
jmiven has quit [Quit: co'o]
<ncthbrt> But even without mirage. Ocaml has enough of the building blocks to be able to happily build microservices
jmiven has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 256 seconds]
hdon has joined #ocaml
<ncthbrt> Drup: I'll see how feasible it is to use tyre on bs-platform, hopefully it is much easier than I think. If not I'll encourage use of ppx and go with simpler implementation. If careful should be able to later switch to full regex engine without breaking anything/anyone.
hdon has quit [Ping timeout: 248 seconds]
malina has quit [Read error: Connection reset by peer]
malina has joined #ocaml
<spew> is there an easy way to have utf-8 encoded unicode identifiers in ocaml?
<spew> that's actually two questions: 1) is there a way 2) what's the easiest way (subjective)
<ncthbrt> To be clear, identifiers (as in things like variable names) or strings?
<Armael> you can with a ppx: https://github.com/whitequark/ocaml-m17n
<spew> yeah I wanted to name a binary operator which signfies "included in" as (⊂)
<discord2> <Perry> It would be interesting to have an article somewhere about building microservices in OCaml. It strikes me as a good "gateway drug" for people putting the language into production.
<discord2> <Perry> Small things with well defined APIs.
gtrak has joined #ocaml
noplamodo_ has joined #ocaml
dhil has joined #ocaml
noplamodo has quit [Ping timeout: 264 seconds]
gtrak has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
yomimono has joined #ocaml
yomimono_ has quit [Ping timeout: 264 seconds]
rostero has joined #ocaml
tarptaeya has joined #ocaml
jimmyrcom_ has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 248 seconds]
struktured has joined #ocaml
sh0t has joined #ocaml
ioanluca has quit [Quit: Page closed]
tobiasBora has quit [Read error: Connection reset by peer]
Fardale has quit [Read error: Connection reset by peer]
Fardale has joined #ocaml
tobiasBora has joined #ocaml
tobiasBora has quit [Read error: Connection reset by peer]
Fardale has quit [Read error: Connection reset by peer]
Fardale has joined #ocaml
tobiasBora has joined #ocaml
tobiasBora has quit [Read error: Connection reset by peer]
Fardale has quit [Read error: Connection reset by peer]
Fardale has joined #ocaml
tobiasBora has joined #ocaml
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
exarkun has joined #ocaml
exarkun has left #ocaml [#ocaml]
ipfix has quit [Ping timeout: 256 seconds]
argent_smith has quit [Quit: Leaving.]
Catherine has joined #ocaml
Catherine is now known as Guest56392
jbrown has quit [Ping timeout: 276 seconds]
gtrak has quit [Ping timeout: 268 seconds]
ipfix has joined #ocaml
gtrak has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
struktured has quit [Ping timeout: 265 seconds]
<discord2> <khady> @Bluddy and now you have received re-created ocaml.org but with a different name 😄
<discord2> <khady> Ocaml.org has a lot of not very clean, not well presented content, I don't think it aims for perfect static content that won't move. Quiet the opposite actually. Just that not enough people contributed to make it big
<discord2> <khady> And it's also some markdown stuff to push in git
<discord2> <khady> Now you have re-created*
<discord2> <khady> Toi many words in my sentence
hdon has joined #ocaml
ctrlsbstr has joined #ocaml
hdon has quit [Ping timeout: 256 seconds]
<discord2> <Bluddy> I get your point, but I still think the 2 are very different. I've answered your point in the original post
<discord2> <ncthbrt> Wow that ppx is insane.
<Khady> Well I'm explaining they are not different
<discord2> <Perry> Ultimately, I think the right thing is to slowly get the web site much easier to contribute to.
<discord2> <Perry> This will require a lot of effort.
jimmyrcom_ has joined #ocaml
<discord2> <Bluddy> If the explanation in my post does work for you, I don't think any other will either. If I want to try out a new section on ocaml.org, can I just get it done? Then to be erased later if needed? Without worrying about the appearance of the site or how I may be messing it up?
<discord2> <Bluddy> A wiki is focused on content, not looks. People know that and expect it. That's what makes it valuable.
<discord2> <Bluddy> I can't go and make every Joe shmoe a maintainer of ocaml.org, for obvious reasons. But I can do it for ocamlverse.
<Khady> All this content is not meant to be nice, there is no special formating
<Khady> And it can be enriched or new pages can be added. As with your "wiki"
<discord2> <Bluddy> Great. Let's give everyone maintainer access then to ocaml.org.
<discord2> <Bluddy> It's the same, right?
<discord2> <Bluddy> There's no html that can get ruined, or anything.
<discord2> <Bluddy> CSS that can be messed up etc.
<discord2> <Perry> I think having a Wiki is reasonable. It allows for experimentation on documenting things.
<Khady> People gonna contribute markdown to your repo too
<Khady> It's the same thing
<Khady> There is no html or css here
<discord2> <Perry> Having an official web site is also reasonable, though right now, the official web site requires too much effort even for the official maintainers to keep up with.
<discord2> <Bluddy> If you give control of ocaml.org to anyone, they will mess it up. There's a whole bunch of extra stuff there.
<Khady> Yeah but the new version of ocamlverse is not a wiki either
<discord2> <Perry> Ultimately we should be encouraging several methods of contributing content, and lowering the barrier to contributing in all of them.
<discord2> <Bluddy> The best content in ocamlverse can be copied to ocaml.org. I have no problem with that.
<Khady> It will never happen
<discord2> <Bluddy> If people prefer ocaml.org's process, let them choose that.
<Khady> As Drup said
<discord2> <Bluddy> OK, you think it'll never happen, but I disagree.
<discord2> <Bluddy> Assuming ocamlverse succeeds at all.
* Khady grabs some popcorn
<discord2> <Bluddy> Learning from one data point ie. awesome-ocaml is not sufficient.
<Khady> It's just one of the latest example to date
<Khady> I don't mind another way to write and gather some content. But let's make it really another way. Not just the same thing under another name
<discord2> <Perry> I think it's okay to have some redundancy so long as we slowly improve the usability of the ecosystem.
<discord2> <Perry> We'll never know what the absolute right way to do something is without experimentation.
jao has joined #ocaml
<companion_cube> it might also fragment documentation a bit further
<companion_cube> it's not like we have that many contributors in the first place
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ncthbrt> How do you contribute to docs?
ctrlsbstr has joined #ocaml
* companion_cube writes doc for his libs, and a tiny bit for the stdlib
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
cbot has joined #ocaml
<discord2> <Perry> companion_cube: There is that. On the other hand, I think people are sufficiently vocal that we'll know about their existence at least.
dhil has quit [Ping timeout: 260 seconds]
jnavila has quit [Ping timeout: 240 seconds]
jao has quit [Remote host closed the connection]
<Khady> Documentation fragmentation is not a problem I think. I mean I know no language for which the doc is in one single place
<discord2> <Perry> In the old days, pretty much all the C docs and C library docs were right on your machine 😃
exarkun has joined #ocaml
jbrown has quit [Ping timeout: 265 seconds]
malina has quit [Remote host closed the connection]
malina has joined #ocaml
Guest56392 has quit [Ping timeout: 260 seconds]
gtrak has quit [Ping timeout: 268 seconds]
gtrak has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 250 seconds]
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dtornabene has joined #ocaml
jimmyrcom_ has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
ctrlsbstr has joined #ocaml
dhil has joined #ocaml
ctrlsbstr has quit [Client Quit]
jimmyrcom_ has quit [Ping timeout: 265 seconds]
ctrlsbstr has joined #ocaml
ctrlsbstr has quit [Client Quit]
<discord2> <Perry> It was really nice, actually. Full sources for the unix manuals came with unix.
Haudegen has quit [Read error: Connection reset by peer]
<discord2> <mars0i> I'd like to suggest that nothing that @Bluddy or others are trying is harming ocaml.org (Awesome OCaml).
<discord2> <mars0i> So though it may be reasonable to advocate direct, immediate contributions to ocaml.org, I don't think the new wiki deseves criticism. Maybe that wasn't anyone's intention.
hdon has joined #ocaml
dogui has quit [Ping timeout: 268 seconds]
gtrak has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
hdon has quit [Ping timeout: 248 seconds]
<steenuil> I'm making some progress in cleaning up the manual's build process
Guest65664 has joined #ocaml
jbrown has joined #ocaml
hdon has joined #ocaml
<discord2> <Perry> I think fixing everything will be slow but that's okay. Slow and steady wins.
<discord2> <Perry> steenuil: thank you for fixing that. I noticed it kept rebuilding things that were already built (including tools that seemed to be in C) when I was fixing the Bigarray stuff.
<steenuil> yeah, for some reason the tools were rebuilt every time
<discord2> <Perry> That slowed down iterative fixing a lot.
malina has quit [Remote host closed the connection]
malina has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
<steenuil> also, ocamldoc used to rebuild docs for the stdlib every time
<discord2> <Perry> And now it does it only when they've changed? If so, that's excellent.
<discord2> <Perry> Octachron?
<steenuil> well, supposedly yes, but if you go and change /stdlib/list.mli and run "make -C manual/manual/library all" it won't notice anything
<steenuil> but I don't think that's a big issue right now
<steenuil> the good thing is that if you run run make all multiple times in the library directory it won't rebuild everything each time
dogui has joined #ocaml
<discord2> <Perry> so I was just editing things in stdlib/ and retyping "make" in manual after. 😦
<discord2> <Perry> So it actually would be helpful if it noticed properly, or it will be a bit harder to do iterative changes to the manual.
<discord2> <Perry> (I was fixing the Bigarray docs for Octachron.)
Guest65664 is now known as Haudegen
exarkun has left #ocaml [#ocaml]
tormen_ has quit [Ping timeout: 246 seconds]
tormen has joined #ocaml
<steenuil> wait no, I think that can be fixed
<discord2> <Perry> cool. 😃
<steenuil> yeah, I fixed it
tormen_ has joined #ocaml
<discord2> <Perry> you rock.
tormen has quit [Ping timeout: 264 seconds]
yomimono has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 264 seconds]
tarptaeya has quit [Quit: Konversation terminated!]
cbot_ has joined #ocaml
cbot has quit [Ping timeout: 240 seconds]
sheijk has quit [Ping timeout: 240 seconds]
sheijk has joined #ocaml
shinnya has joined #ocaml
dtornabene_ has joined #ocaml
dtornabene has quit [Read error: Connection reset by peer]
dtornabene_ has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 268 seconds]
kakadu has quit [Quit: Konversation terminated!]
demonimin has quit [Remote host closed the connection]
<discord2> <Perry> Anyone around (Octachron or other) who understands Hevea? I'm having trouble with \ahrefloc
<octachron> Perry, \hyperref, \hyperref, \hyperref ?
<octachron> Perry, notice the title of the section: http://hevea.inria.fr/doc/manual018.html#hevea_default59
<discord2> <Perry> "Generating html constructs" ?
<octachron> these are html-only macros
<discord2> <Perry> I am afraid my knowledge of hevea consists of what you've told me so far. Anyway, hyperref it is!
<discord2> <Perry> Any idea how I can link the Bigarray libref html file?
<discord2> <Perry> the hevea manual doesn't mention hyperref. 😐
<octachron> Perry, correction, they probably are also defined in the hevea package on the latex side, which is not currently used by the manual (?)
johnelse has quit [Ping timeout: 256 seconds]
<discord2> <Perry> "c:" in the labelname is for chapter?
<octachron> Perry, do you want to link to the biggaray module or libbigarray.etex?
<octachron> c:…, s:…, yes; it is mostly a convention
<discord2> <Perry> I think I figured it out. \ahref to libref/Bigarray.html
<discord2> <Perry> this is so ugly.
jack5638 has quit [Ping timeout: 246 seconds]
ctrlsbstr has joined #ocaml
jack5638 has joined #ocaml
<discord2> <Perry> Okay, Octachron, it should be done now.
<discord2> <Perry> Wow that last bit was too painful.
FreeBirdLjj has quit [Remote host closed the connection]
<discord2> <Perry> It took maybe 1/4 of the time of everything else for a couple of hyperlinks.
ygrek has joined #ocaml
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<octachron> Perry, thanks a lot for taking the time
kakadu has joined #ocaml
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
<discord2> <Perry> Hey, if I want a better manual the least I can do is try to help with fixing things, right?
<discord2> <Perry> I presume this will get cherry picked to 4.07?
<steenuil> ...wait a second. the "all" target for some reason rebuilds the PDF manual three times
<steenuil> thankfully it never gets run by any other makefile, it seems.
<discord2> <Perry> steenuil: I'm really really happy you're doing this fix.
sz0 has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
<octachron> Perry, yes, this is necessary piece for 4.07
<octachron> steenuil, did you take the fact that latex need to build twice?
argent_smith has joined #ocaml
<steenuil> ah, I assumed it'd be something like that
<discord2> <Perry> twice is needed, is three times done to reach a point where it doesn't change?
<steenuil> now that you mention it, hevea does say something about reaching a fixpoint after a few rebuilds
<octachron> twice is needed to build the toc and references information first, before really building
<steenuil> ah, that makes sense.
<octachron> but thrice is needed is some specific configuration (with bibtex I think?), so waiting to reach for a fixpoint is a "current" build strategy
<octachron> common build strategy*
<octachron> steenuil, yes, it made sense in the 80s when parsing full text was too expansive in term of memory
<steenuil> yeah, it makes sense for something as old as latex that is
<steenuil> reminds me of how I've read somewhere that people used to recommend running "sync" thrice before shutting down a unix computer
<Drup> octachron: you might need to run latex up to 4 times
pierpal has joined #ocaml
<Drup> Actually, you need to reach fixpoint, so it's technically unbounded, but in practice, I have never seen more than 4, with a 3rd pass for macro expension *after* numeroting of section, then a 4th pass for accurate page numbering in references
jimmyrcom_ has joined #ocaml
<Drup> (for example, that happens often with beamer+tikz overlays)
<steenuil> that's horrifying.
<Drup> steenuil: I have beamer slides that take 2 minutes to compile :D
<Drup> (that's for one run :D)
<octachron> Drup, I would have bet on beamer
<steenuil> wow
<steenuil> I just do presentations in Racket
<Drup> note that while working, you almost always only need the last run
<octachron> I ended up writing a limited haskell parser for my defense to at least catch basic syntax error
<Drup> steenuil: hmm, I'm curious, is there a good framework for slides in racket ?
<steenuil> yeah, racket/slide, the only issue is that you can only do 4:3 presentations
<octachron> TeX design as a programming language is absolutely horrifying. You don't want to climb that high in Chomksy hierarchy
<Drup> steenuil: that's not really a problem for me
<steenuil> and if you want anything more complicated than text and lists and picture you have to output the picts yourself, but that's not much of a limitation
<Drup> what is a problem is the impossibility to reuse latex things that I used in the paper, for example
<steenuil> ah, good point
<Drup> (I tend to go a bit bananas with fancy tikz figures, and I need to typeset type rules, so ...)
<steenuil> if you really wanted you could write a Racket #lang that parsed latex and output picts for your slides
<discord2> <Perry> TeX is a terrible programming language. Knuth is so brilliant, but his taste in certain things was never good, and that is one of them.
<Drup> steenuil: that means implementing the full pgf/tikz
<Drup> I am *never* doing that
<Drup> like, no, plz, that's insane
<discord2> <Perry> The problem is LaTeX has just so much labor in it that replacing the TeX language isn't going to happen. I think what could be done would be to create something in parallel that had a second syntax to get to the TeX language so people could slowly get away from it.
<steenuil> unfortunately Racket doesn't have good support for writing stuff like papers (yet)
<discord2> <Perry> "Path dependence" is what economists call this.
<hdon> can discord people see irc messages?
<steenuil> yeah
<discord2> <Perry> I'm on Discord.
jnavila has joined #ocaml
<Drup> Perry: I would say "sunk cost". :)
<discord2> <Perry> The two-way bridge is clunky right now on the IRC side but it is going to be fixed as soon as the Freenode people give permission for multiple TCP connections for it.
<hdon> cool
<Drup> I never tried luatex
<Drup> I think it doesn't support so many packages
jbrown has quit [Ping timeout: 255 seconds]
spew has quit []
<steenuil> incidentally, I think Racket would be a good language for implementing something like what Perry said, considering its language ecosystem and things like Scribble
<Drup> and the fact that it's very flexible, syntax wise
<Drup> I'm playing with plt-redex lately, and I'm very positively impressed
<steenuil> Drup: maybe this could be of interest? https://github.com/jeapostrophe/slideshow-latex
<steenuil> I think it just renders stuff with latex and turns it into a bitmap, but at least it's something
<steenuil> by the way, "make pregen" in the manual dir with no changes went from 3.70s to 0.10
<steenuil> and it I "touch ../stdlib/list.mli" it's 1.70s
hdon has quit [Changing host]
hdon has joined #ocaml
Algebr` has joined #ocaml
yomimono has joined #ocaml
jnavila has quit [Ping timeout: 256 seconds]
_andre has quit [Quit: leaving]
rostero has quit [Quit: Connection closed for inactivity]
Algebr` has quit [Ping timeout: 268 seconds]
dhil has quit [Ping timeout: 240 seconds]
malina has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
pierpa has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
yomimono has quit [Ping timeout: 260 seconds]
zmt00 has quit [Quit: Leaving]
zmt00 has joined #ocaml
jbrown has joined #ocaml
argent_smith has quit [Quit: Leaving.]
rwmjones|bcn is now known as rwmjones
Haudegen has quit [Read error: Connection reset by peer]
silver_ has joined #ocaml
silver has quit [Read error: Connection reset by peer]
pierpal has quit [Ping timeout: 240 seconds]
sh0t has quit [Read error: Connection reset by peer]
sh0t has joined #ocaml
jack5638 has quit [Ping timeout: 260 seconds]
tilpner has quit [Ping timeout: 260 seconds]
Soni has quit [Ping timeout: 240 seconds]
Soni has joined #ocaml
ncthbrt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tilpner has joined #ocaml
zlsyx has joined #ocaml
yomimono has joined #ocaml
jack5638 has joined #ocaml
shinnya has joined #ocaml
cheesy has joined #ocaml