adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org and http://caml.inria.fr | http://ocaml.org/releases/4.02.0.html | Public channel logs at http://irclog.whitequark.org/ocaml
AltGr has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
sheijk_ has quit [Ping timeout: 244 seconds]
sheijk has joined #ocaml
bezirg has quit [Quit: Leaving.]
<mcc> so, couple questions
<mcc> one, how do i load a .ml file in the current directory when running utop? i tried "open Token" to open token.ml but it just said "syntax error"
<mcc> two, ... i feel super dumb i can't figure this out from the docs but how do i create an item of a particular record type?
<whitequark> #use "token.ml"
<whitequark> and you just do {a=1;b=2;} where a and b are fields of that record.
<mcc> 'k. how does it disambiguate?
<malc_> mcc: it doesn't
<whitequark> it does, since 4.02
<mcc> so if type a = {x:int;};; and type b = {x:int;};; are a and b interchangeable?
<whitequark> no
<whitequark> if you use the definitions above, you can't make a record of type a
<whitequark> not even in 4.02
<mcc> b simply hammers it?
<whitequark> yeah
<mcc> huh.
manizzle has quit [Ping timeout: 245 seconds]
<whitequark> oh, actually, you can
<whitequark> # ({ x = 1 } : a);;
<whitequark> - : a = {x = 1}
<mcc> ok.
<whitequark> essentially, when there is an ambiguity, it uses contextual clues to figure out what type will it be
<mcc> but because everything is so strongly typed, i do not need to worry about "accidentally" making an item of the wrong type.
<mcc> i'll just make a b and then get an error that a b shouldn't be there?
<whitequark> indeed
mcclurmc has joined #ocaml
<whitequark> it can be annoying if there is a lot of fields with identical names, but it's still safe
<mcc> 'k
<mcc> so something i feel like i might want is two versions of a struct, one mutable, one non-mutable
<mcc> i mean record
<mcc> so that i can construct the record bit by bit then freeze it into nonmutable form
<whitequark> that sounds like a job for a recursive function, without an intermediate data structure
shinnya has joined #ocaml
mcclurmc has quit [Ping timeout: 245 seconds]
araujo has quit [Ping timeout: 245 seconds]
araujo has joined #ocaml
<whitequark> generally, if one has to have a lot of records with maybe similar fields in the same module, people put a prefix to every field name
<whitequark> parsetree.mli (http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/trunk/parsing/parsetree.mli?view=markup), representing OCaml's AST, is a particularly egregious example
<whitequark> the P stands for Parsetree. you'd also have Typedtree, with the T prefix: http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/trunk/typing/typedtree.mli?view=markup
<whitequark> and thus you can even bring them all in a single namespace (with open)
<mcc> hm
<mcc> so a problem i am looking at here is that i have a naturally recursive function which builds something up over time, where some things are known early and like, one thing known only late
madroach has quit [Ping timeout: 250 seconds]
<mcc> so i'm thinking about the recursive function i'd need to keep all the intermediate state "in the air" until everything that goes in the record is known, and it seems like this is gonna be a function with many arguments
<mcc> but this is a big match statement, so this seems a lot of repetitive code
<mcc> i'm thinking about doing something silly like having the match statement return a fn or something, but...
madroach has joined #ocaml
pestle has joined #ocaml
manud has joined #ocaml
bezirg has joined #ocaml
<whitequark> that's actually not a bad idea, if it fits your task well
<whitequark> I wrote code like that
<whitequark> so, hm, what I would do is to do something like:
<whitequark> let rec fn ~a ~b ~c ~d next =
<whitequark> let fn = fn ~a ~b ~c ~d in
<whitequark> and then you'd call (fn next) when you want to process the next element.
sheijk_ has joined #ocaml
sheijk has quit [Ping timeout: 250 seconds]
<mcc> oh oh that's interesting
malc_ has quit [Ping timeout: 264 seconds]
Submarine has joined #ocaml
darkf has joined #ocaml
mcclurmc has joined #ocaml
ygrek has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
sheijk_ has quit [Ping timeout: 255 seconds]
dav_ has joined #ocaml
dav has quit [Ping timeout: 265 seconds]
mcc has quit [Quit: This computer has gone to sleep]
lordkryss has quit [Quit: Connection closed for inactivity]
bytbox has quit [Remote host closed the connection]
bezirg has quit [Ping timeout: 256 seconds]
jao has quit [Ping timeout: 245 seconds]
araujo has quit [Quit: Leaving]
sheijk has joined #ocaml
dav_ has quit [Ping timeout: 245 seconds]
sheijk has quit [Ping timeout: 265 seconds]
artagnon has joined #ocaml
<artagnon> whitequark: What does "bus error" at execution time mean?
<artagnon> Have I messed up my ctypes definition?
<whitequark> artagnon: possibly
<whitequark> run it in gdb.
* artagnon nods
<artagnon> frame #0: 0x0000000100fe605a rhine`llvm::GCModuleInfo::getOrCreateStrategy
<artagnon> it's my gc.
dav has joined #ocaml
<artagnon> Thanks, I'll continue debugging.
<artagnon> I forgot that lldb is now available since we're linking to my build of llvm.
shinnya has quit [Ping timeout: 244 seconds]
govg has quit [Remote host closed the connection]
q66 has quit [Quit: Leaving]
govg has joined #ocaml
sheijk has joined #ocaml
artagnon has left #ocaml [#ocaml]
sheijk has quit [Ping timeout: 265 seconds]
<Drup> companion_cube: add the special gadt-proof table where we have type of the value depending of type of the keys in Containers
<Drup> (get : Table.t -> 'a key -> 'a val)
<Drup> see near my previous HL for a link to an implementation
badkins has joined #ocaml
badkins has quit []
cdidd has quit [Remote host closed the connection]
kandu has quit [Quit: leaving]
cdidd has joined #ocaml
artagnon has joined #ocaml
<artagnon> whitequark: Is get_pointer_to_global working perfectly?
<artagnon> I'm getting a type mismatch when I say returning (a struct).
<artagnon> I saw your example in the test where you pass an integer and get out an integer.
<whitequark> uh, I have no idea, ask @yallop on the ocaml-ctypes bugtracker
<artagnon> Cool, will do.
sheijk has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
sheijk has quit [Ping timeout: 260 seconds]
jabesed has quit [Ping timeout: 244 seconds]
tangentstorm has left #ocaml ["WeeChat 0.3.2"]
Submarine has quit [Remote host closed the connection]
<artagnon> Never mind; I just forgot to deref a pointer.
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
mcclurmc has joined #ocaml
kandu has joined #ocaml
bytbox has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
kandu has quit [Quit: leaving]
emery has joined #ocaml
manud has quit [Quit: Lingo: www.lingoirc.com]
rgrinberg has joined #ocaml
pestle has quit [Ping timeout: 245 seconds]
larhat has quit [Quit: Leaving.]
ygrek has joined #ocaml
mcc has joined #ocaml
hightower4 has quit [Ping timeout: 272 seconds]
<mcc> ok so... this is explained in one of these documents i have open, i know it, but i can't find it...
<mcc> i am defining a function like (let a b = b) or something. how do i explicitly give the function's return type?
<mcc> if i say let a b : int = x, or something, i'm just specifying b's type, i think
<Drup> let f x : int = x
<whitequark> let f x : int
<Drup> to specify x's type : "let f (x:int) = x"
<whitequark> mcc: to specify x's type, you'd have let f (x : int)
<whitequark> argh
<Drup> to specify both "let f (x:int) x : int = x"
sheijk has joined #ocaml
<Drup> meh, one extract x
<Drup> whitequark: too slow :p
<mcc> i think i asked this question wrong
<mcc> let f x : int = x (* this means... takes one argument, argument is an int
<Drup> no, this means takes ones argument and returns an int
<mcc> ok. and in order to specify argument, i must explicitly parens?
<Drup> yes
<mcc> lovely, thanks
<mcc> ...huh. interesting how two very similar programs produce very different ocamlopt build times
siddharthv_away is now known as siddharthv
nicoo has joined #ocaml
sheijk has quit [Ping timeout: 255 seconds]
<Drup> ?
<mcc> oh, i just... i had a program, i changed it not-a-lot, ocamlopt took like 10x more time to complete afterward than before.
<mcc> ok, so here is a question: http://i.imgur.com/77OJjWJ.png ... that second function. that seems like... a lot of code duplication. is there any way to cut down on that?
<Drup> why do you give me a picture of the code instead of a pastebin ? T__T
<mcc> that's a fair question, actually
<mcc> here. the function dumpTree in this file. yes, i know it's non-exhaustive. https://bitbucket.org/runhello/emily/src/e0f2a6166a442fe54ca938a7824a7b60f2d3ac8d/src/token.ml?at=default
<Drup> I was curious about the change to the program to increase the compile time that much
<mcc> oh! um, it was a couple things i guess
<mcc> i think it was the addition of dumpTree. is uncovering check-exhaustiveness time consuming?
<Drup> no, it's not
<Drup> more likely, you just added something to emit, instead of just typechecking.
<Drup> slightly less code duplication :)
<mcc> ok
<Drup> you can't do much better without code generation
<mcc> oh! that's neat
<mcc> with the delayed ->
hausdorff has joined #ocaml
dav_ has joined #ocaml
dav_ has quit [Changing host]
dav_ has joined #ocaml
dav has quit [Ping timeout: 265 seconds]
kdef has quit [Remote host closed the connection]
hightower4 has joined #ocaml
bytbox has quit [Remote host closed the connection]
Submarine has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
hausdorff has quit [Ping timeout: 244 seconds]
gustav___ has quit [Ping timeout: 244 seconds]
gustav___ has joined #ocaml
gustav___ has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 245 seconds]
sheijk has joined #ocaml
samrat has joined #ocaml
ggole has joined #ocaml
<mcc> is there a way to write a nullary function in ocaml
<mcc> like, a function that takes unit, or something
<mcc> ...
<mcc> oh.
<mcc> you just write a function that takes unit.
<mcc> well then
<ggole> All functions are technically unary.
<ggole> Taking unit is close enough though.
sheijk has quit [Ping timeout: 250 seconds]
dav_ has quit [Ping timeout: 245 seconds]
dav has joined #ocaml
ygrek has joined #ocaml
gustav___ has joined #ocaml
<dmbaturin> mcc: Note that you always need to write the unit argument when calling such a function. It has bitten me several times when I forgot it.
<flux> quite back luck if you don't get an error or warning out of it, though
<flux> a/back/bad/
<Drup> It's more than bad luck, I don't see how it's possible
<Drup> except if you silence the warning about non-unit expression in sequence, but you deserve it then
gustav___ has quit [Ping timeout: 255 seconds]
<dmbaturin> Drup: If it also returns unit, and you attempt to call it from the top level, and you are lazy to match it on unit and just add a ;; ... :)
gustav___ has joined #ocaml
<dmbaturin> * lazy enough
<Drup> Oh, top level, okay.
<dmbaturin> Since then I always use let () = matching so silly mistakes become type errors.
ygrek has quit [Ping timeout: 265 seconds]
psy_ has quit [Remote host closed the connection]
<flux> dmbaturin, btw, do you know you can write programs without using ;; at all? then you get to use let () = .. for top-level statements, though I suppose you could still use let _ = .. ;)
<flux> hmh, I suppose you do and that's what you were referring to
<dmbaturin> flux: Sure, with matching on unit I also don't need ;;'s
dav has quit [Ping timeout: 264 seconds]
dav has joined #ocaml
keen___________0 has joined #ocaml
keen____________ has quit [Ping timeout: 245 seconds]
sheijk has joined #ocaml
gustav___ has quit [Ping timeout: 260 seconds]
BitPuffin has quit [Ping timeout: 264 seconds]
sheijk has quit [Ping timeout: 264 seconds]
MercurialAlchemi has joined #ocaml
gustav___ has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ygrek has joined #ocaml
gustav___ has quit [Ping timeout: 265 seconds]
gustav___ has joined #ocaml
psy_ has joined #ocaml
dav has quit [Remote host closed the connection]
gustav___ has quit [Ping timeout: 260 seconds]
<mcc> Is there a way to get ocamlopt to stop giving me this "Hint" http://pastebin.com/Dr8YXr7p
<Drup> that's ocamlbuild, not ocamlopt
dav has joined #ocaml
<Drup> and the way is indicated in the message, "create an empty '_tags' file"
<mcc> OK. And that will have no effect?
<Drup> It shouldn't
gustav___ has joined #ocaml
dav has quit [Ping timeout: 240 seconds]
<Drup> you will need to put stuff into _tags at some points anyway.
<Drup> (like, as soon as you will want external dependencies)
<mcc> No, the tags is in src/
<Drup> Oh.
<Drup> you could put it on layer above
dav has joined #ocaml
<Drup> it's usually how it's done anyway
<Drup> but yeah :/
<mcc> I'm specifically trying to quarantine all source stuff in src/ and all build stuff in _build/ and have the two be separate.
<mcc> "Usually how it's done" with OSS projects, IME is that the root of the project is just a big splay of confusing junk and you don't know what is what and helpessly look for an INSTALL file
rgrinberg has quit [Quit: Leaving.]
<Drup> No, I mean, just the _tags file
<Drup> not every sources
<mcc> I feel like the _tags is an extension of the source as it describes the source's properties
<whitequark> mcc: use something like ocamlbuild -tag-line '"src": traverse'
gustav___ has quit [Ping timeout: 264 seconds]
<mcc> oh
<mcc> ...neat
<mcc> wait hold on will that make it recursively traverse src
gustav___ has joined #ocaml
<mcc> i don't want it to recursively traverse, i want it to do exactly what it's doing but not print a superfluous warning
<whitequark> not recursive, no
<whitequark> that'd be "true: traverse"
<mcc> ah.
<mcc> with ocamlbuild -use-ocamlfind -tag-line '"src": traverse' src/main.native it still printed the _tags message
<mcc> i will just have the Makefile create an empty _tags
<mcc> I feel more ok with garbage files being created by the make system than being checked in
<whitequark> hm
<ggole> That's not a great idea, because sooner or later you'll want to add something to it.
<Drup> ggole: cf above :p
<ggole> Right.
<mcc> hm
<whitequark> mcc: I don't really understand why it displays the message
<mcc> i guess... ok, so that's nonfatal because when i want to add something I just add something and check it in... but then hg starts complaining every time I traverse the boundary between "_tags checked in" and "no _tags checked in". Bah.
<whitequark> .hgignore?
<ggole> _tags should probably be under vc though
<whitequark> mcc: if you give me something to reproduce it I might figure out a cleaner way
<whitequark> I looked into ocamlbuild source and I have no fucking clue what is the condition for displaying the message
<mcc> whitequark: i think i can do that easily... later.
<whitequark> it does ... something ... with expanding paths
<Drup> "ocamlbuild does something"
<mcc> I'm not sure if .hgignore gets me out of this. the problem is hg gets upset if you try to update from a version that has a file named _tags that it didn't create, to a version where it needs to create a file named _tags...
<Drup> I think it's the most acurate description I've read about ocamlbuild
<mcc> i think overall ocamlbuild did not expect that you are trying to build out of a source directory other than cwd.
<Drup> oh no, that works fine
<mcc> anyway, this is not important
<whitequark> mcc: I've just tried to: touch src/main.ml; ocamlbuild src/main.native; and it doesn't display the hint
<whitequark> I don't really get why it does, in your case
<Drup> it did no expect you to put the _tags not in the root directory
<Drup> which is different
<mcc> whitequark: what if you have _tags in src/ but not in pwd
<whitequark> same thing
<whitequark> it's something else
<mcc> that's... odd. by the way, i think it might only be printing the message when the build fails.
<mcc> give me a second...
<whitequark> oh
<whitequark> oh yes it does
<whitequark> wow who thought this is a good idea
<mcc> wait, seriously, that was it?
<mcc> that's... weird
<mcc> so seriously, is there a ticket system for all this stuff?
<mcc> cuz i had another "super small, but weird" observation about ocamlbuild--
<mcc> "ocamlbuild -use-ocamlfind src/main.native" prints a newline at the end of execution. "ocamlbuild -clean" does not
<Drup> =')
<mcc> coooool. i think whitequark linked me that at one point but then i lost it
<whitequark> it... does for me
<whitequark> -clean
<mcc> i'm gonna just file it myself. it will be my INTRODUCTION TO THE TICKET PROCESS.
<mcc> rly
<whitequark> even with -classic-display, yeah
<Drup> to be honest, the fancy display of ocamlbuild is broken in my terminal and I don't like it
<Drup> so I use the classic display
<whitequark> I don't know why the fancy display exists.
<mcc> i… whoa what the heck!
arj has joined #ocaml
gustav___ has quit [Ping timeout: 240 seconds]
<mcc> okay, so here's what it does on my system
<mcc> i look at that and i go... hmm, i wonder what would happen if the window would be a different size.
<mcc> i widen the window.
<whitequark> oh
<whitequark> oh it actually does this on mine, too
<whitequark> I just never noticed
<mcc> Glossolalia!
<mcc> ok. i'm just gonna file it
<whitequark> indeed
<Drup> yes, it uses escape sequences badly
<Drup> in my terminal, it starts by printing things
<whitequark> I... still can't trigger the useless ocamlbuild 'hint' thing
gustav___ has joined #ocaml
<Drup> then process to erase the content of the terminal backward
<whitequark> the part about compilation failure is there, in the source
<whitequark> but for the love of my life I can't figure out how to actually invoke it
<Drup> whitequark: it's usually the opposite problem, you don't know which code path is executed and you want to find out :D
<mcc> would you happen to know how to use hg? try this:
<Drup> that would probably be a fun tool to do, "given a point in the program, give me a path that go there"
* whitequark hates hg more than git, soooo probably not
<Drup> I saw a paper about something close, in last CC conference
<whitequark> Drup: NO I DON'T WANT A FUCKING PAPER, I WANT CODE WHICH ACTUALLY MAKES SENSE
<whitequark> ahem.
<Drup> ahah xD
<mcc> hg clone https://runhello@bitbucket.org/runhello/emily && cd emily && hg up b6ffed8d2c6b && make
<mcc> that will download the repo and check out a revision exhibiting the problem
<whitequark> okay, sources! let me try this out
<mcc> (make will fail. that is expected.)
<whitequark> right, reproduced it
<Drup> whitequark: you do realize you don't really have to convince me on this ? :)
<mcc> it seems kind of weirdly specific.
<mcc> i mean, if it only occurs in this wierd collection of situations, it doesn't seem like a very good warning.
q66[lap] has quit [Read error: Connection reset by peer]
<whitequark> mcc: I'm trying to phrase a reply that consists of something more than "ocamlbuild" and expletives
<whitequark> shortly, yes.
* ggole mumbles something about build systems and suffering
q66[lap] has joined #ocaml
<mcc> "the suffering of javascript developers" appears quite high in that search
gustav___ has quit [Ping timeout: 256 seconds]
<mcc> bug system is asking for platform. I'm including my platform. whitequark, you said you saw the funny newline thing after ocamlbuild -clean? what platform was that on?
<whitequark> mcc: in this case the terminal is relevant, so, konsole
<whitequark> on debian
gustav___ has joined #ocaml
<mcc> 'k thanks
zpe has joined #ocaml
sheijk has joined #ocaml
mort___ has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 240 seconds]
<whitequark> wow, there is an option -no-skip
<whitequark> it makes ocamlbuild not display the hint. it also makes it *hide the compiler error*
<mcc> that is
<whitequark> what the fuck, ocamlbuild
<mcc> ...that is not a helpful feature
<mcc> what does "skip" mean in this context
<whitequark> I have no idea, the variable in ocamlbuild source is called Options.ignore_auto
<whitequark> ... and I have no idea how *any* of that relates to this at all
<whitequark> oh, it gets better!
<Drup> -no-skip Don't skip modules that are requested by ocamldep but cannot be built
<Drup> It doesn't really make more sense ...
<whitequark> you can pass both -no-skip and -classic-display
<mcc> D:
<whitequark> in which case it will both hide the error message and output three screens of junk
<whitequark> (╯°□°)╯︵ ┻━┻
<Drup> <3
<MercurialAlchemi> "OCaml Tooling vs Predator", next summer's blockbuster
<Drup> If I may, all the tooling is not bad
<flux> whitequark, I think you should use autoconf
ygrek has joined #ocaml
<flux> it would solve all your problems.
<Drup> only the build systems.
sheijk has quit [Ping timeout: 264 seconds]
<whitequark> flux: did you just tell me to fuck myself?
<MercurialAlchemi> Drup: ok, where is my debugger?
<Drup> It's called printf :<
<flux> whitequark, maybe I did.. maybe I didn't.
hausdorff has joined #ocaml
<MercurialAlchemi> Yeah, considering that my real-life debugging experience includes inspecting third-party libraries three level deep, that's not very reassuring
<ggole> I'd rather a better toplevel than a debugger
<adrien> gdb
<Drup> I'd rather a debugger than contains a toplevel.
<flux> imagine a world.. where a top-notch debugger was integrated into the toplevel.
<ggole> (Although that would probably change as soon as I had to work on somebody else's code...)
<whitequark> flux: I've used make, autoconf, cmake, waf, ocamlbuild, ocamlmakefile, omake, ocp-build, shellscripts, rake, ant, maven, leiningen, gyp and qmake
<MercurialAlchemi> I'll admit that Merlin is awesome, though, and opam and utop are pretty good
<whitequark> I have seething hate for all of them.
<MercurialAlchemi> whitequark: "you are all equally worthless"? :)
<flux> cmake isn't all bad with c(++)?-(
larhat has joined #ocaml
<whitequark> HAHAHAHAHAHA
<flux> though you're not the first to have those sentiments towards it
<ggole> Even some small things like backtraces in the toplevel would be helpful
<whitequark> I had to do some major CMake work for LLVM recently.
<whitequark> CMake is worse than autoconf.g
<MercurialAlchemi> well, Maven works as long as you don't want to do anything complicated, and it has some good ideas
<whitequark> significantly.
<whitequark> autoconf is just misguided. cmake is downright developer-hostile.
<Drup> MercurialAlchemi: are we talking about the eclipse thing ?
<whitequark> you couldn't make a worse fucking buildsystem if you deliberately tried
<MercurialAlchemi> Drup: well, there is an Eclipse plugin for it, but you don't need Eclipse to use it
gustav___ has quit [Ping timeout: 272 seconds]
<MercurialAlchemi> as long as your editor can edit XML files
<MercurialAlchemi> obviously, as soon as you try to get off the rails, you'll find out about the barbed wires and the landmines on the side
gustav___ has joined #ocaml
<MercurialAlchemi> whitequark: Did you try premake?
<MercurialAlchemi> I used it briefly, before I remembered exactly why I so love c++, wasn't that bad
<whitequark> MercurialAlchemi: it'll probably end up a sixteenth buildsystem that I hate
<MercurialAlchemi> write your "makefile" in a lua dialect, no weird case-insensitive macros of hell
<mcc> i… was that a joke, that sounds lovely
<mcc> i actually at one point tried to write some build scripts in lua but it turned out LuaFileSystem is surprisingly hard to get working with luajit
<whitequark> okay, premake actually sounds half-decent
<mcc> oh wow you mean premake is the system where the makefiles are a lua dialect
<mcc> d… does the dialect have closures
<MercurialAlchemi> of course, I only used for a short time on a small project, so I didn't get the opportunity to throw things at it
<whitequark> I think it's just Lua, not actually a separate implementation
<whitequark> (that would be super weird)
<MercurialAlchemi> it's just Lua, yes
<MercurialAlchemi> but you can write your "makefile" in something that looks declarative
<mcc> cool
<whitequark> mcc: I give up, I'm not a good enough programmer to figure out how to make ocamlbuild not display that
<mcc> build systems are such that "we made a lua variant, to no benefit to us, and now will maintain it forever" would be a *relatively not that weid* decision to make
<mcc> whitequark: haha. ok. maybe i'll file something later
gustav___ has quit [Ping timeout: 245 seconds]
<whitequark> mcc: yes exactly, I wouldn't even be really surprised
<whitequark> mcc: please use the word "burn" in the issue title
gustav___ has joined #ocaml
<mcc> oh dear
MercurialAlchemi has quit [Remote host closed the connection]
* adrien hugs whitequark
<adrien> for the cmake comments :P
<whitequark> adrien: at this point I actually prefer debugging m4.
MercurialAlchemi has joined #ocaml
<whitequark> that were not words that I thought I would ever say, yet still
<adrien> cmake is meant for Visual Studio first and compatible for other systems too, probably because they couldn't get any traction otherwise
<adrien> whitequark: :)
<whitequark> cmake is meant as a divine punishment for the transgressions of mortals
<whitequark> "I wish you had to use cmake" is a good curse.
<mcc> ouch
<mcc> i don't
<mcc> i don't think i'd actually wish that on ANYONE.
<mcc> except maybe the cmake maintainers, because there are definitely features of the program itself they've clearly never attempted, and if they had to maybe it would work better
<MercurialAlchemi> I think the conclusion is that making build systems is hard
<MercurialAlchemi> I did hear some good things about leiningen, though
* ggole fantasizes about redirecting the effort put into optimizing php and javascript into build system design
<mcc> somebody's making a javascript based build system
<mcc> and, truth be told, i was seriously considering using it
<ggole> What could possibly go wrong?
<ggole> Well, good luck I guess.
<mcc> well, i'm not using it.
<mcc> I'm using Make :(
<mcc> I'm using a bizarre, 14-line Makefile wrapper on ocamlbuild because I wanted it to store the build product somewhere different from its default :(
<MercurialAlchemi> miam
<ggole> Yeah, I wrap ocamlbuild in make too
<MercurialAlchemi> I generally just adapt my latest oasis build file
<MercurialAlchemi> (where generally = instance_count(2) )
<MercurialAlchemi> ggole: you could have the best of both worlds, you know
<ggole> I could probably do something with myocamlbuild.ml or _tags to obviate the makefile, but I actually can't bring myself to look at the documentation.
<MercurialAlchemi> a PHP-with-JS build system
<whitequark> documentation? which documentation?
<MercurialAlchemi> use Apache and a web browser to create builds
<whitequark> I just take a deep breath, open the source and try to direct the hate in less destructive ways
<ggole> It's so much easier to fart around on the command line to figure out a param that does what I want, and just add that.
<whitequark> oh, yeah, I mean if you need to write myocamlbuild rules
<ggole> Yeah, I try to avoid that.
<whitequark> like, if people wrote documentation and generally improved ocamlbuild instead of writing their pet shitty broken buildsystem, it would be actually usable
<whitequark> but noooo, the NIH is especially rampant here
<MercurialAlchemi> whitequark: it depends how broken the original source is and/or if you have radically different ideas
<whitequark> it's not too broken.
<whitequark> it had had some corners cut, that's clear. it's very much fixable. I mean, I use it in its current state just fine.
jonludlam has quit [Quit: Coyote finally caught me]
<MercurialAlchemi> I like the idea of oasis, because I like declarative build systems with hooks, but I'm a bit worried that one day I may have to do something complex with it and blow my foot off
<whitequark> having tried to do complex things in OASIS, I can say that at the moment you need something else than "compile an ml library" it is easier to ditch OASIS than to make it do what you want.
<MercurialAlchemi> I'll try to stick to simple things
<MercurialAlchemi> is it maintained?
hausdorff has quit [Remote host closed the connection]
<whitequark> .... welll
hausdorff has joined #ocaml
<whitequark> it's not what *I* would call "maintained", but technically yes
<Leonidas> well, since gildor moved to google, maintenance has been sloooow.
<whitequark> gildor is at google now? O_o
<whitequark> why
<flux> hmm, maybe he likes to buy food?
<Leonidas> thats also the time where forge started deterioriting
dav has quit [Remote host closed the connection]
dav has joined #ocaml
<flux> google is clearly intimidated by the competition brought by ocaml against go.
<Leonidas> actually, oasis kinda also works when you want to compile a ml library with c parts :-)
<whitequark> Defense and Security O_o
<Leonidas> hahaha
hausdorff has quit [Ping timeout: 265 seconds]
<MercurialAlchemi> So they're buying off the competition, I see
<Leonidas> you need to buy food at google?
<flux> leonidas, it's a worldwide conspiracy, really. there are these big companies ('banks') that have made deals with other companies, that if people work for them, they increase a counter in their database system
<flux> leonidas, then again there are more deals that food outlets give out food only to folks with some numbers in the database
<MercurialAlchemi> I'm told violence can work too, but only a limited number of times
<MercurialAlchemi> I'll note that in some locations, you can also obtain food via food stamps
sheijk has joined #ocaml
sheijk has quit [Ping timeout: 244 seconds]
<MercurialAlchemi> I've just thought about a business model
<MercurialAlchemi> What about recovery clinics for Java developers?
<MercurialAlchemi> They could do some OCaml without the 'O', and learn to live without inheritance, nulls and mutability
<arj> realworldocaml is down? anyone responsible here to fix this?
<arj> the paper version of the book is at home… :/
q66[lap] has quit [Read error: Connection reset by peer]
<mcc> addToLineProceed ( token ( Number (float_of_string(Sedlexing.Utf8.lexeme buf)) ) )
<mcc> ... would there happen to be any suntactic tricks for cutting down on my a(b(c(d(e problem there
<mcc> like i think haskell has $ or something for this. i don't know what $ does.
q66[lap] has joined #ocaml
<mcc> i guess i could do something weird with o
<mcc> ( ( addToLineProceed o token o Number o float_of_string o Sedlexing.Utf8.lexeme) buf )
<MercurialAlchemi> you can always |>
<arj> mcc: you might use |> as in x |> f |> g is exactly equivalent to g (f (x)).
<mcc> hm, ok. don't suppose there is a <| ?
vogler has joined #ocaml
<whitequark> I think the equivalent of haskell's $ is @@
<whitequark> there is no equivalent of haskell's . though
<mcc> i thought . was just o
<mcc> what's @@ do
<whitequark> I don't know what o does
<mcc> (f o g)( x ) === f(g(x))
<whitequark> let (@@) f x = f x
<whitequark> let (|>) x f = f x
<mcc> 'k
<arj> mcc: where is o defined ?
<mcc> and @@ is infix
<whitequark> both
<mcc> arj: … … … in sml/nj?
<arj> ah, I see.
<arj> not Ocaml.
<mcc> arj: ok, sorry, i sorta assumed it carried over here.
<Drup> by "o", I suppose you mean ∘
<mcc> ok. now i know.
<Drup> #utf8 pedanticness
<mcc> ok. anyway, SML/nj has a compose operator, and ocaml doesn't, but i did not know that :)
<whitequark> Drup: not · ?
<mcc> I'ma use @@. thanks all
<whitequark> huh, I have no idea how to type that via compose
<Drup> whitequark: no, functional composition is the ring
<Drup> middle dot is usually scalar product :p
<whitequark> ... one ring to bring them all and in the darkness bind them
<mcc> that's probably the null ring
<Drup> I'm sad to inform you that you are not the first one to do this joke.
<whitequark> meh
<MercurialAlchemi> always had trouble parsing point-free style in Haskell
<mcc> gonna design my own language and add @_@ and >_> operators
<whitequark> I just call it point-less
<whitequark> mcc: ooooh you just reminded me
<whitequark> one moment
<mcc> …uh oh
<MercurialAlchemi> hahaha, nice
ollehar has joined #ocaml
<MercurialAlchemi> after brainfuck, smileyfuck
<MercurialAlchemi> arg, I don't have the right font for that
<Drup> peh :p
<mcc> :O
<Drup> :D
<mcc> hey wait wait wait wait
<mcc> could... i just say
zpe has quit [Remote host closed the connection]
<mcc> val <| = @@
<mcc> i could do that couldn't i
<whitequark> let (<|) = (@@)
<whitequark> but yes
<mcc> awesomes
zpe has joined #ocaml
<Drup> but you should burn in hell for eternity if you do that in a project.
<whitequark> that's too harsh.
<mcc> oh come on
<MercurialAlchemi> I'd make a language which forces third-party libraries to get a license for ASCII operators
<mcc> mercurialalchemist: ... i'll think about it
<whitequark> MercurialAlchemi: that is actually not that bad of an idea
<Drup> mcc: exactly the same as people who redefine true and false.
<mcc> ...why are people redefining true and false
<MercurialAlchemi> just subcontract to the BSA and RIAA for enforcement
<whitequark> try in toplevel: type burn_in_hell = true;; true;;
<Drup> whitequark: oh no, you can do *much* better
<whitequark> yes. yes, I know. yes, I remember *that* example by now.
<Drup> type burn_in_hell = true of bool ;; true true;;
<whitequark> can you not damage irreparably the mind of a novice ocamller at least once, okay?
<mcc> i did mention i've written a great deal of perl, right?
<mcc> i've seen some shit
<whitequark> mcc: well, execute his example
<mcc> also i'm pretty sure I've namespace-stomped String at least once in this project. I need to stop using "open"
mort___ has joined #ocaml
<mcc> i think i see what it's going to do, but
zpe has quit [Ping timeout: 265 seconds]
<Drup> let s = string_of_bool false in s.[0] <- 't' ; s.[1] <- 'r' ; s.[2] <- 'u' ; s.[3] <- 'e' ; s.[4] <- ' ' ;;
<Drup> Printf.printf "%B" false ;;
<Drup> do this one.
<Drup> mcc: and yes, avoid open if possible :)
<mcc> Warning 3: deprecated: String.set
<mcc> Use Bytes.set instead.
<mcc> It didn't seem to do anything.
<Drup> use the second line, look at the output.
<whitequark> mcc: what did printf print, though?
<arj> Drup: what is wrong with the example you gave with burn_in_hell ?
<mcc> Seemingly nothing. I got dozens of lines of warnings, and then: - : unit = ()
<Drup> mcc: the *second* line ;)
<arj> I tried it in utop and it evaluates to true true;;
<mcc> okay, i see now
<MercurialAlchemi> that's positively evil
<Drup> arj: yes, isn't it weird that I can use the second true without arity ? :p
<arj> ah! sure...
<arj> how does this work?
<Drup> deep magic :p
<arj> does ocaml use arity to figure out which type it is?
<arj> (or even type?)
<Drup> nope, this other way around
<Drup> record and variant disambiguation
<arj> hehe, ok. But still a crazy example.
<arj> A bit like overloading in other languages…
<MercurialAlchemi> Drup: isn't there something about making strings immutable in the future?
<mcc> does ocaml have falsy values
<whitequark> nope, if only works with bool
<mcc> or... hm.
<mcc> yeah, that sounds like nonsense.
<mcc> good solution.
<whitequark> I recently broke llvm trunk CI for hours, because python treats "" as falsey
<Drup> MercurialAlchemi: it's already there, but opt-in for now
<MercurialAlchemi> right
<MercurialAlchemi> that'd break your second trick
<Drup> yes
<Drup> to be precise, this trick was presented on the ocaml workshop to show "what should not be possible", when XL presented the new feature :)
<mcc> whitequark: it turns out there is actually an ideologically consistent reason for this!
<mcc> notice i did not say "good".
<MercurialAlchemi> right
<MercurialAlchemi> immutability for the people
<whitequark> mcc: "all empty iterators are falsey and None is an empty iterator" or something?
<Drup> mcc: the same kind of ideological reasons that makes python not having tail rec ? :)
<mcc> whitequark: the consistent rule is that arithmetic identity is always falsey
<mcc> whitequark: for any type which has an addition-like operator. 0, "", [], set()
<whitequark> None does not have an addition-like operator
<mcc> heh
<Drup> I was going to make fun of the whole concept "rules with exceptions" but then I though about the ocaml syntax :(
<MercurialAlchemi> it's not so bad
<MercurialAlchemi> I mean, it reads ok, and it's not too trippy
<Drup> it's full of corner cases and it would be much more simple
<Drup> could*
<whitequark> Drup: where in the world is the operator precedence/fixity table in the manual?
<whitequark> I can't find it
<Drup> the links to follow are "The OCaml language" > "Expressions" > .
<whitequark> Drup: ... why on earth is ~- treated specially
<Drup> for the syntax "-3" of course
<whitequark> huh? how could redefining ~- change that?
<whitequark> I mean, redefining && breaks laziness
<whitequark> Drup: also, that is the wrong table
<whitequark> oh
<whitequark> there are two
<Drup> No it's not, scroll.
<whitequark> yeah I scrolled too far
<whitequark> because having operator precedence table in the section about operators is too fucking straightforward
<flux> but it has function application too :)
ikaros has joined #ocaml
govg has quit [Quit: leaving]
sheijk has joined #ocaml
AltGr has left #ocaml [#ocaml]
<whitequark> Drup: it's actually not treated specially.
<whitequark> not in the sense that %sequand is
<Drup> huuum
sheijk has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
<mcc> addToLineProceed @@ token @@ Number(float_of_string @@ Sedlexing.Utf8.lexeme @@ buf)
<mcc> (I just want it on the record i'm frustrated I can't remove that one last set of parenthesis)
<whitequark> нщг сфт
<whitequark> argh
<whitequark> you can
<whitequark> @@ fun x -> Number x @@ ...
<whitequark> I think.
<mcc> interesting
<whitequark> hm, that seems to get precedence wrong
<mcc> frankly, i've just done the entire thing with a ( ( ( ( chain
<mcc> also, google translate translates the cyrillic there as "nschg SFT" which, since that kind of sounds like frustrated noises, seems like maybe an accurate translation
<whitequark> wrong layout
<mcc> anyway addToLineProceed(token(Number(float_of_string(Sedlexing.Utf8.lexeme(buf))))) isn't very pretty but it is immediately obvious what it does
<mcc> ah.
<whitequark> it's "you can" in RU
<mcc> ooo
<mcc> good phrase
<whitequark> I mean, in RU layout
<whitequark> not the language lol
<whitequark> mcc: so what I usually do is |>
<whitequark> in this case you can actually use fun x -> Number x trick
<whitequark> and it looks pretty.
<MercurialAlchemi> It would look better if you directly use the constructor as a function
<mcc> ok. so. just so i understand
jonludlam has joined #ocaml
<mcc> addToLineProceed(token(Number(float_of_string(Sedlexing.Utf8.lexeme(buf))))) (* this does the right thing
<mcc> | number -> addToLineProceed @@ token @@ fun x -> Number x @@ float_of_string @@ Sedlexing.Utf8.lexeme @@ buf (* this is an error message
<mcc> File "src/tokenize.ml", line 40, characters 53-121: Error: This expression should not be a function, the expected type is Token.tokenContents
<whitequark> yes, because it gets parsed as fun x -> (Number x @@ float_of_string @@ ...)
<mcc> oooo...
<mcc> would <| have had this problem
<whitequark> yes, because fun x -> binds tighter than any operator
kakadu has joined #ocaml
<mcc> 'k
<whitequark> so, yeah, buf |> Sedlexing.Utf8.lexeme |> float_of_string |> fun x -> Number x |> token |>addToLineProceed
<whitequark> it's like the shell pipe, hence |>
<mcc> ok sorry
<mcc> when i said "would <| have had this problem" i emant "would |> have"
<whitequark> oh.
<mcc> if -> binds tighter than any operator, why didn't it mess up with |>
<whitequark> because in this case the code is still correct
<mcc> oh
<whitequark> fun x -> (Number x |> token |> addToLineProceed)
<whitequark> does exactly what you want there
<mcc> oh. interesting.
<whitequark> it also reads from left-to-right and I mean
<whitequark> we're in a left-to-right reading culture
<whitequark> why the hell would anyone use $
<mcc> is $ just @@
<whitequark> let me check
<mcc> the reason i want @@ is it's like a left-paren i don't have to close
<whitequark> yes, $ is the same as @@
<mcc> side note: so i pull out my "open"s. there is some code in tokenize.ml which uses Number, which is defined in token.ml . it realizes Number is in token, goes ahead and pulls it out, announces it did this and makes it a warning.
<mcc> That's... incredibly cool and kind of terrifying. I gave it no clue how to find Number and it just FOUND it.
<whitequark> yes, it's type-driven
<whitequark> something was of type Token.t and another thing was unified with that
<whitequark> so it sees "Number" with type Token.t and there's no Number in scope
<whitequark> but Token.t defines a Number constructor, so it's even safe
<whitequark> the reason there is a warning is that slight changes to code may alter the path of the inference and it will no longer find the constructor
<mcc> right
<mcc> the warning is very sensible
<mcc> just curious, is there some kind of equivalent of python "from blarg import gnfnrf" as a kind of half-step toward "open"
<mcc> or is that what you define an MLI for
<whitequark> you can manually pull out values and types
<whitequark> type t = Foo.t
<whitequark> let v = Foo.v
ingsoc has joined #ocaml
<whitequark> module M = Foo
<ggole> You can do this locally, too
dav has quit [Ping timeout: 250 seconds]
<whitequark> in the former case the constructors aren't pulled out though.
<ggole> Foo.(zonk whorf blat)
<mcc> yeah ok
<whitequark> which is sugar for "let open Foo in zonk whorf blat"
sheijk has joined #ocaml
<whitequark> which does exactly what you expect
<mcc> incidentally, i'm STILL very confused about when you use a record and when you use a not-file-level module
<mcc> errrr wait
<whitequark> modules are basically records with types
<mcc> you mean records which are allowed to contain types
<whitequark> there is actually an ML variant which unifies modules and records.
<whitequark> yes
<mcc> ok. that makes sense
<ggole> The types are the compile time part, really
<ggole> They don't exist in the physical structure
<whitequark> idiomatically, no one ever uses modules for data storage, though
<whitequark> it's technically possible but ogh
<whitequark> *ugh
Guest94041 has joined #ocaml
<whitequark> generally, you use regular (not first class) modules for namespacing, and first-class modules when you need to store a record and associated type(s)
<mcc> i think for a bit i thought people were using modules for data storage but no they were really using module.t for data storage
<whitequark> say, if you have a list of some plugins, and you have a create function that returns an opaque type and some other functions that consume it
<mcc> like i think i had an analogy in my head between module-with-functor and class-with-template in cpp and i followed it a little too literally
<whitequark> oh
<mcc> anyway, i think i get it better now
dsheets has joined #ocaml
<companion_cube> Drup: you mean put mixtbl in containers? it doesn't even need GADTs ;°
Simn has joined #ocaml
<mcc> if i wanna build up a string letter by letter what is the most efficient way to do that
<mcc> like... this. this doesn't seem efficient or tail-recursive or anything
<mcc> let rec countdown x = match x with | 0 = "" | x = (string_of_int x) ^", "^countdown(x-1) in countdown 10;;
<mcc> and i think they said ^ allocates a new string every time although idk if that's actaully a problem
<mcc> also that doesn't compile, hopefully you see what i was trying to do, it was an example
demonimin_ has quit [Ping timeout: 260 seconds]
<whitequark> Buffer.t
<whitequark> Buffer.add_char
<mcc> neat.
<MercurialAlchemi> buffer is your friend, indeed
bezirg has joined #ocaml
kandu has joined #ocaml
<whitequark> your only friend
<whitequark> learn to love buffer, and it will love you in turn
_andre has joined #ocaml
lordkryss has joined #ocaml
demonimin has joined #ocaml
<MercurialAlchemi> You can use the Format package to printf things to it
<MercurialAlchemi> just don't forget to flush
<mcc> so, uh, question
<mcc> buffer stores... what exactly
<mcc> or, maybe the question I really want to ask here: do i use add_char, add_string, or add_bytes if i want to add a unicode value
<Drup> companion_cube: I didn't say it was using gadts, I say it was gadt-proof
<whitequark> add_string.
<Drup> said*
<mcc> by "unicode value" i mean whatever Sedlexing.Utf8.lexeme returns
<mcc> ok
<MercurialAlchemi> don
<MercurialAlchemi> grr
<MercurialAlchemi> yeah, 'char' in ocaml parliance is just a byte
<mcc> ok
<mcc> what's a "string" and how is it different from a "bytes"
<mcc> is this python 3 or hell world
<MercurialAlchemi> a string is a collection of bytes
<mcc> ok
<mcc> the buffer doc is making explicit reference to a type named "bytes" http://caml.inria.fr/pub/docs/manual-ocaml/libref/Buffer.html
<mcc> is that a more different collection of bytes
<whitequark> MercurialAlchemi: uhhhh no that is completely wrong
<MercurialAlchemi> and a "bytes" is... well, essentially the same
<MercurialAlchemi> no?
<whitequark> mcc: "string" is immutable, "bytes" is mutable
<dsheets> string = bytes unless --safe-string then string is immutable
<whitequark> in the transitional period, to which 4.02 belongs, both are treated the same unless you pass -safe-string
<whitequark> which will later become default.
<MercurialAlchemi> how is a string not a collection of bytes?
<whitequark> you should specify true: safe_string in your _tags to write future-proof code.
<dsheets> gah non-gnu cli args
<Drup> whitequark: the 'fun x -> Number x |>' works mostly by accident, if I might.
<MercurialAlchemi> (not as in the 'bytes' OCaml type)
<whitequark> mcc: re python3: right now ocaml does not require or recognize utf-8 anywhere at all.
<mcc> ok. that's unfortunate.
<whitequark> there are external libraries which allow you to work with utf-8, however the core language doesn't care
<mcc> but workable, um, one thing tho
<whitequark> (uutf uucd and a few others)
<MercurialAlchemi> yeah, if you want to store three-quarters of an utf-8 char in a string, OCaml won't complain
<MercurialAlchemi> on the other hand you're less tempted to think that everything is fine and dandy because your string data type is UTF-16
<MercurialAlchemi> since it isn't
<Drup> mcc: it's actually a good thing.
<Drup> the language doesn't care, so it's not going to mess things up under the hood :)
q66[lap] has quit [Read error: Connection reset by peer]
<mcc> It seems problematic because it seems to create a situation where I can't call the methods in the String class very safely.
<mcc> i mean module.
<whitequark> indeed, String is useless with unicode
<flux> hmm, type utf8_string = private string, it would work with immutable strings
<Drup> mcc: considering your question about building strings (or array, if you want store UChars), use the init function
q66[lap] has joined #ocaml
<mcc> is that the one that calls a callback repeatedly?
<Drup> yes
<mcc> i... like that but i am not *sure* i can use it because i'm doing something stateful.
<mcc> i'm working with sedlexing which is naturally vending from something with state.
<whitequark> so, Sedlexing.lexeme returns you an int array
<whitequark> which is an array of codepoints
<whitequark> you can just use that directly and encode it into utf if you need to display it or when you finish the processing.
ygrek has quit [Ping timeout: 264 seconds]
<mcc> ok. um.
<mcc> i was staring at Sedlexing for a while trying to figure out if that was the case or not
<Drup> it wouldn't be a bad thing to integrate Sedlexing.Utf8 and Uucd further
<whitequark> oh?
<mcc> val lexeme: lexbuf -> string
<mcc> (** As [Sedlexing.lexeme] with a result encoded in UTF-8. *)
<mcc> that seems to me to say no, lexeme will return me a series of bytes in utf8?
<whitequark> Sedlexing.Utf8.lexeme and Sedlexing.lexeme
<whitequark> different functions
ygrek has joined #ocaml
<whitequark> you're taking about Utf8 one
<mcc> ooooo
<Drup> x)
<whitequark> "⁨⁡ Dinner 㰠 Min Kenaoqinru ∽ Minke 㸢 pond 㵭 contravene enemy prison ਾ observing the Minke 㰾 observing the drama Zhi elata 㹶 㰊 㹹 careful with Rui & T."
<whitequark> is it trying to warn me of something
<flux> it's utf alright
<Drup> Ah, I have a different result than you, whitequark :D
<flux> I can't find a single western alphabet there
<whitequark> Drup: I put it through google translate
<flux> :)
<flux> Kenaoqinru, zero google matches. how can this be!
bezirg has quit [Remote host closed the connection]
<mcc> Huh!
ygrek has quit [Ping timeout: 272 seconds]
q66[lap] has quit [Ping timeout: 250 seconds]
<mcc> That's a bit frustrating and may explain the weird _tags "hint"
<mcc> i say: ocamlbuild -use-ocamlfind src/main.native
<mcc> this produces a file named: main.native
<mcc> not src/main.native
<mcc> ... any idea why?
<Drup> sure, since it's executed in ., not in src
<whitequark> it produces _build/src/main.native and also tries being helpful and symlinks it to the root
<Drup> you can tell him not to do symlinks, iirc
<mcc> " -no-links "
<mcc> it worked yay
<Drup> I find the symlinks nice ...
<Drup> why don't you want them ?
<mcc> call me picky but i really would like it if my source files were in src/ and nowhere else, my intermediate build products were in _build/ and nowhere else, and my final build outputs in package/ (flexible on name here) and nowhere else
<mcc> and if the project root were a series of directories of obvious function, one README, and MAYBE a Makefile.
<flux> for some reason the ocaml compiler never learned to find sources from directory other than where it produces the binaries
<flux> I guess nobody wrote the code to do that :)
<whitequark> it sort of can do that
<mcc> flux: so, this is the odd thing. if i say ocamlbuild -no-links src/main.native
<Drup> mcc: it's not a final product, it's a symlink
<whitequark> but not in all cases and it doesn't always work
<mcc> flux: it will place a copy of main.native into _build/src/main.native
<whitequark> mcc: nonono, it's the other way around
<whitequark> main.native is a symlink to _build/src/main.native
<mcc> it will place a copy of a file named main.native into that place
<mcc> the thing i want to call attention to is at no point does it actually create a file src/main.native
<mcc> so i think this is dubious
<whitequark> um, no, it doesn't work like make.
<mcc> i think if i told it to create src/main.native, it would be a more understandable behavior if it were to create a symlink, or a file, or anything, in src/main.native
<whitequark> ocamlbuild places *everything* into _build
<mcc> ok.
<whitequark> (except the symlinks)
<mcc> i mean, the current behavior is what i *want*.
<whitequark> okay
<whitequark> oh, gotcha
<mcc> it's just philosophically odd to me.
<whitequark> it is a bit odd indeed.
<mcc> anyway, the #1 reason i don't want the main.native symlink created is i am not at any point seeking to create a binary named main.native
<mcc> the next step in my makefile is to cp the file out of _build and rename it to "emily". :P
<Drup> why would you do that ?
<mcc> because that is the name of the program.
<Drup> well, then name it that way when installing
<mcc> okay. does ocamlbuild have an install step?
<whitequark> yeah, that part is annoying to me as well
<whitequark> it doesn't.
<Drup> (oasis does)
<whitequark> it's a build system, not install system :p
<mcc> i think copying to "package' is part of the install step
<mcc> which is another reason i want everyhting in package, there will likely be other files in there at some point
arj has quit [Quit: Leaving.]
<Drup> let's just say this is not very idiomatic in the ocaml way of composing a package :D
<flux> I think copying stuff around the source tree is not installing ;)
<whitequark> Drup: saying that you should just take main.native and shut up prior to installing is bullshit
<flux> rather, preparing for an install
<Drup> whitequark: i'm saying that trying to do some workaround ocamlbuild is not better.
<whitequark> Drup: what
<Drup> workaround around* (this doesn't sound nice :/)
Thooms has joined #ocaml
<whitequark> "to work something around"
<Drup> hum, right.
<whitequark> and no, of course it's better, it allows you to do what you want
<mcc> i think, i might be more concerned about what is idiomatic for an ocaml project if i were explicitly making a project that targeted ocaml users.
<mcc> but i'm not, i'm targeting emily users, and whatever i do gently hints at what might be idiomatic for emily users in future, assuming more than two people ever use this.
<Drup> whitequark: and the "meh, it's call main" is a non-issue, just call your main emily and done, and it's not even a bad thing to call it like that, since there is no notion of main file in ocaml.
<whitequark> then it'd be emily.native
<whitequark> not emily
<Drup> is that terrible ?
<mcc> … … … although come to think of it, if i DID match ocaml idioms well, i could maybe distribute this thing through opam... hmm.
<mcc> and i'd rather not name main emily because 'main' to me is specifically the *interface for the commandline tool*.
<mcc> in the long run this may not be the only or even primary way of interacting with the software, for all i know.
<Drup> right, that's a fair argument
<whitequark> mcc: it will be not a problem to distribute this via opam in any case.
<whitequark> like, if you can make it support "make install DESTDIR=x", it's opam-ready.
<Drup> whitequark: I'm not saying that what is doing ocamlbuild is good (I don't like it), I'm just saying that considering it's a very minor inconvenient, being consistent with all the other packages using ocamlbuild/oasis is slightly more important
<mcc> cool.
<Drup> (let's be honest here, it's *very* minor)
ebzzry_ has joined #ocaml
ebzzry has quit [Ping timeout: 264 seconds]
<mcc> grumble grumble...
Guest94041 has quit [Ping timeout: 260 seconds]
<mcc> so is PPX the kind of thing i could use to make a thing where like, [%construct(Word)] could turn into (fun x -> Word x)
dav_ has joined #ocaml
<Drup> [%construct Word]
<Drup> but yes
<Drup> this one is quite trivial to write, even
<mcc> cool
<mcc> maybe that'll be my project for tomorrow :P
<Drup> whitequark: you could make an updated version and put it on ocaml.org
<mcc> i've seen it! but thanks for the reminder ^_^
<whitequark> maybe I should
ebzzry_ has quit [Remote host closed the connection]
<ggole> Oof, first class polymorphism is kinda heavy in OCaml
<ggole> Can't just (fun a b -> ...) :(
siddharthv is now known as siddharthv_away
<ggole> ...or { f = fun a b -> ... }
<mcc> ok, thanks again all. goodnight!
mcc has quit [Quit: /quit]
arj has joined #ocaml
dav_ has quit [Remote host closed the connection]
dav_ has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
dav_ has quit [Remote host closed the connection]
dav_ has joined #ocaml
larhat1 has joined #ocaml
malc_ has joined #ocaml
larhat has quit [Ping timeout: 245 seconds]
Thooms has quit [Quit: WeeChat 1.0.1]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
axiles has joined #ocaml
BitPuffin has joined #ocaml
waneck has quit [Quit: Leaving]
malc_ has quit [Ping timeout: 240 seconds]
samrat has joined #ocaml
govg has joined #ocaml
malc_ has joined #ocaml
vfoley has quit [Remote host closed the connection]
bytbox has joined #ocaml
bytbox has quit [Remote host closed the connection]
Thooms has joined #ocaml
hhugo has joined #ocaml
malc_ has quit [Ping timeout: 250 seconds]
sepp2k has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
thomasga has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
ygrek has joined #ocaml
ysz has joined #ocaml
jonludlam has joined #ocaml
hhugo has quit [Quit: Leaving.]
<Unhammer> # NDBM not found, the "camldbm" library cannot be built.
<Unhammer> anyone know what ubuntu package that is?
<Unhammer> (I'm guessing it's some non-ocaml prereq at least)
<MercurialAlchemi> libgdbm3, probably
<MercurialAlchemi> (on Debian)
<Unhammer> ah, that seems to have worked, thanks MercurialAlchemi :)
mort___ has quit [Ping timeout: 245 seconds]
* Unhammer is trying out eliom
darkf has quit [Quit: Leaving]
thomasga has quit [Quit: Leaving.]
shinnya has joined #ocaml
panini has joined #ocaml
<Drup> Oh :o
samrat has quit [Ping timeout: 255 seconds]
dav_ has quit [Remote host closed the connection]
dav has joined #ocaml
hhugo has joined #ocaml
AlexRussia has quit [Ping timeout: 250 seconds]
samrat has joined #ocaml
araujo has joined #ocaml
hhugo has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
dav has quit [Remote host closed the connection]
dav has joined #ocaml
AlexRussia has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
panini has quit [Quit: Leaving]
ebzzry has joined #ocaml
evert_ has left #ocaml [#ocaml]
samrat has quit [Ping timeout: 272 seconds]
bernardofpc has joined #ocaml
<kakadu> I always use sqlite
<kakadu> instead dbm
* kakadu is wondering why sqlite is not set by default..
samrat has joined #ocaml
<jpdeplaix> Kakadu: you should use dbm. Its performances are **way** better.
shinnya has quit [Ping timeout: 256 seconds]
ikaros has quit [Quit: Ex-Chat]
dav has quit [Ping timeout: 245 seconds]
dav has joined #ocaml
dav has quit [Ping timeout: 244 seconds]
dav has joined #ocaml
<arj> though you cannot use fancy SQL ;-)
<Drup> it's used for a kv inside eliom
<Drup> kv store*
<Drup> so, no need for fancy sql
<MercurialAlchemi> yeah, depends on what you need
avsm has joined #ocaml
<MercurialAlchemi> though I can't really think of a single time where something like this would have been useful for anything else than caching, in which case I'd have gone for memcached or something like that
emery has quit [Remote host closed the connection]
emery_ has joined #ocaml
panini has joined #ocaml
serge has quit [Remote host closed the connection]
serge has joined #ocaml
govg has quit [Quit: leaving]
larhat1 has quit [Quit: Leaving.]
bytbox has joined #ocaml
artagnon has left #ocaml [#ocaml]
boogie has joined #ocaml
manizzle has joined #ocaml
badkins has joined #ocaml
kakadu has quit [Ping timeout: 246 seconds]
arj has quit [Quit: Leaving.]
hausdorff has joined #ocaml
zpe has quit [Remote host closed the connection]
MrScout has joined #ocaml
seanmcl has joined #ocaml
boogie has quit [Remote host closed the connection]
ysz has quit [Quit: Leaving]
<Drup> MercurialAlchemi: you mean, a kv store ?
ygrek has quit [Ping timeout: 272 seconds]
govg has joined #ocaml
<MercurialAlchemi> Drup: yes
<MercurialAlchemi> Drup: what do you guys use it for?
<Drup> in this case, it's server side session data
<MercurialAlchemi> right
<MercurialAlchemi> I guess the specs are unlikely to evolve toward something more relational
<Drup> I don't see why it would
<Drup> It has been there since quite a long time and it's serving it's purpose quite well
<Drup> hum, for* >_>
boogie has joined #ocaml
<adrien> its*
<adrien> :)
<Drup> that too.
ollehar has quit [Ping timeout: 258 seconds]
martintrojer has quit [Ping timeout: 272 seconds]
martintrojer has joined #ocaml
cespinoza has joined #ocaml
hausdorff has quit [Remote host closed the connection]
Hannibal_Smith has joined #ocaml
yomimono has joined #ocaml
cespinoza has quit [Client Quit]
hausdorff has joined #ocaml
trystero is now known as tristero
dav has quit [Ping timeout: 258 seconds]
dav has joined #ocaml
zpe has joined #ocaml
vogler has quit [Ping timeout: 250 seconds]
hausdorff has quit [Remote host closed the connection]
Anarchos has joined #ocaml
badkins has quit []
sheijk_ has joined #ocaml
sheijk has quit [Ping timeout: 265 seconds]
mcc has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
q66[lap] has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
avsm has quit [Quit: Leaving.]
q66 has joined #ocaml
bytbox has quit [Remote host closed the connection]
dav has quit [Ping timeout: 255 seconds]
axiles has quit [Remote host closed the connection]
hausdorff has joined #ocaml
avsm has joined #ocaml
dav has joined #ocaml
badkins has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
ggole has quit []
dav has quit [Ping timeout: 256 seconds]
dav has joined #ocaml
hausdorff has quit [Remote host closed the connection]
panini has quit [Remote host closed the connection]
hausdorff has joined #ocaml
avsm has quit [Quit: Leaving.]
Thooms has joined #ocaml
jabesed has joined #ocaml
dav has quit [Remote host closed the connection]
dav has joined #ocaml
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Thooms has quit [Quit: WeeChat 1.0.1]
Thooms has joined #ocaml
lordkryss has joined #ocaml
jonludlam has joined #ocaml
dav has quit [Ping timeout: 255 seconds]
Guest35292 has joined #ocaml
yomimono has joined #ocaml
kakadu has joined #ocaml
samrat has quit [Ping timeout: 272 seconds]
<Drup> Unhammer: thanks a lot for the remarks, keep adding them. I will fix them all in a batch by the end of the week
<Unhammer> :)
<Unhammer> have to downgrade to 4.0.1 to keep following the tutorial it seems
<Unhammer> ojwidgets wants an older js_of_ocaml
samrat has joined #ocaml
* Unhammer → tv
<Drup> oh, ojwidgets :<
<Drup> we may not have released a new version of this one
samrat has quit [Ping timeout: 250 seconds]
<mcc> Hey, um, is there anyone who might be able to help me understand sedlex's odd metaprogrammy magic?
<mcc> i'm looking at the docs and the code https://github.com/alainfrisch/sedlex/ and i'm trying to figure out... is there a way to pass a regexp to a function.
<mcc> The doc says: "It is possible to define named regular expressions with the following construction, that can appear in place of a structure item: let lid = [%sedlex.regexp? R]"
<mcc> i assume "structure item" is a piece of ocaml jargon i don't know
<Drup> a structure item is "something that goes at the top level"
<Drup> "let x = ..." "module M = ..." "type .. = ..."
<mcc> but it seems to complain if i pass [%sedlex.regexp? R] into a function, or return it from a "match"
<mcc> ok. so it seems like it isn't actually saving a value into a bound variable named "lid", but rather it is somehow adding a lid : something map to some lookaside table somewhere/
<Drup> I didn't look at the code, but that's indeed what I assumed when I read the doc
maurer_ is now known as maurer
<mcc> ok. so it wouldn't surprise you if these "variables" are magic and can't be used in expressions containing variables?
<Drup> mcc looked at the code, yes, you can't use them like normal values
<Drup> (I must say, it's not elegant)
badkins has quit [Ping timeout: 255 seconds]
badkins has joined #ocaml
<mcc> heh
<mcc> thanks!
travisbrady has joined #ocaml
samrat has joined #ocaml
hausdorff has quit [Remote host closed the connection]
MrScout has quit [Remote host closed the connection]
manizzle has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 265 seconds]
manizzle has joined #ocaml
hausdorff has joined #ocaml
WraithM has joined #ocaml
MrScout has joined #ocaml
bytbox has joined #ocaml
travisbrady has quit [Quit: travisbrady]
ebzzry has quit [Remote host closed the connection]
Arsenik has joined #ocaml
sepp2k has quit [Quit: Konversation terminated!]
Hannibal_Smith has quit [Read error: No route to host]
guest293 has joined #ocaml
guest293 is now known as mostruktured
MrScout has quit [Ping timeout: 272 seconds]
NoNNaN has joined #ocaml
Guest35292 has quit [Remote host closed the connection]
larhat has joined #ocaml
MrScout has joined #ocaml
dav has joined #ocaml
manud has joined #ocaml
hausdorff has quit [Remote host closed the connection]
travisbrady has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
manud_ has joined #ocaml
_andre has quit [Quit: leaving]
manud has quit [Ping timeout: 245 seconds]
ebzzry has joined #ocaml
samuel02 has joined #ocaml
claudiuc has joined #ocaml
hausdorff has joined #ocaml
hausdorff has quit [Ping timeout: 244 seconds]
yomimono has joined #ocaml
MrScout has quit [Remote host closed the connection]
NVry has joined #ocaml
MrScout has joined #ocaml
NVry has quit [Client Quit]
lordkryss has quit [Quit: Connection closed for inactivity]
MrScout has quit [Ping timeout: 244 seconds]
jwatzman|work has joined #ocaml
hausdorff has joined #ocaml
nlucaroni has quit [Quit: leaving]
pyon has quit [Remote host closed the connection]
manud_ has quit [Quit: Be back later ...]
manud_ has joined #ocaml
badkins has quit []
zpe has quit [Remote host closed the connection]
manud__ has joined #ocaml
manud_ has quit [Ping timeout: 244 seconds]
struktured_ has joined #ocaml
manud__ has quit [Ping timeout: 265 seconds]
struktured_ is now known as struk_at_work
manud__ has joined #ocaml
samuel02 has quit [Remote host closed the connection]
hausdorff has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 255 seconds]
mostruktured has quit [Remote host closed the connection]
hausdorff has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 258 seconds]
zpe has joined #ocaml
WraithM has quit [Quit: leaving]
typedlambda has quit [Ping timeout: 250 seconds]
Submarine has quit [Ping timeout: 255 seconds]
MrScout has joined #ocaml
typedlambda has joined #ocaml
sheijk has joined #ocaml
sheijk_ has quit [Ping timeout: 240 seconds]
Submarine has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
hausdorff has quit [Remote host closed the connection]
BitPuffin has quit [Remote host closed the connection]
hausdorff has joined #ocaml
Arsenik has quit [Remote host closed the connection]
avsm has joined #ocaml
yomimono has joined #ocaml
samuel02 has joined #ocaml
hausdorff has quit [Remote host closed the connection]
manud__ has quit [Quit: Be back later ...]
MrScout_ has joined #ocaml
ingsoc has quit [Quit: Leaving.]
samuel02 has quit [Ping timeout: 255 seconds]
kakadu has quit [Quit: Konversation terminated!]
MrScout has quit [Ping timeout: 272 seconds]
MrScout_ has quit [Ping timeout: 260 seconds]
thizanne has quit [Ping timeout: 245 seconds]
MrScout has joined #ocaml
WraithM has joined #ocaml
boogie has quit [Quit: Leaving...]
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
MrScout has quit [Ping timeout: 265 seconds]
yomimono has quit [Ping timeout: 256 seconds]
<Denommus> sorry for the stupid question, but is there any certification program for OCaml?
Simn has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
lordkryss has joined #ocaml
hausdorff has joined #ocaml
thomasga has quit [Quit: Leaving.]
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
travisbrady has quit [Quit: travisbrady]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
serge has quit [Remote host closed the connection]
serge has joined #ocaml