ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
jbrown has quit [Remote host closed the connection]
javamonn has joined #ocaml
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
struktured has quit [Ping timeout: 245 seconds]
rkat has joined #ocaml
philtor has joined #ocaml
badkins has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
ljs has joined #ocaml
philtor has joined #ocaml
hilquias has quit [Remote host closed the connection]
javamonn has quit [Remote host closed the connection]
cmtptr has joined #ocaml
rgrinberg has joined #ocaml
<rgrinberg> Hello
ytse-pyon is now known as idem-pyon-tent
javamonn has joined #ocaml
claudiuc has quit [Remote host closed the connection]
BitPuffin has quit [Ping timeout: 252 seconds]
claudiuc has joined #ocaml
gabemc has joined #ocaml
claudiuc has quit [Ping timeout: 245 seconds]
philtor has quit [Ping timeout: 276 seconds]
seangrove has quit [Ping timeout: 250 seconds]
<zump> guys.. when is oCAML gonna take off !!
<jpdeplaix> if someone who has archlinux wants to take care of an aur package, this one is orphan: https://aur.archlinux.org/packages/ocaml-safepass/
<jpdeplaix> I can't maintain it anymore
lordkryss has quit [Quit: Connection closed for inactivity]
<Drup> zump:
<Drup> # TimeTravel.(predict OCaml_world_domination) ;;
<Drup> Exception: TimeTravel.Impossible_to_predict.
shinnya has joined #ocaml
<zump> Drup: what about ocaml on embedded systems.. native compiler..
<Drup> what about it ?
idegen has quit [Remote host closed the connection]
idegen has joined #ocaml
MrScout has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
MrScout has joined #ocaml
darkf has joined #ocaml
ljs has quit [Quit: None]
<dubosec> hi rgrinberg
<dubosec> I just want to say this channel has been very open and helpful. Thanks everyone!
idegen has quit [Ping timeout: 255 seconds]
ggole has joined #ocaml
struktured has joined #ocaml
ericwa has quit [Quit: Leaving...]
olibjerd has quit [Ping timeout: 250 seconds]
struktured has quit [Ping timeout: 265 seconds]
giselle has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
dubosec has quit [Quit: Leaving]
<giselle> hi, can I link a .cmxs library when compiling with ocamlopt? if so, how?
javamonn has quit [Remote host closed the connection]
struktured has joined #ocaml
<smondet> giselle: you mean without any build-system doing that for you? it should be the option `-shared`
<giselle> smondet: I had understood that -shared would create a cmxs... I tried that and get the error message: "don't know what to do with *.cmxs"
<giselle> it never knows what to do with cmxs files :)
badkins has quit []
WanderingGlitch has quit [Ping timeout: 256 seconds]
tristero has quit [Ping timeout: 276 seconds]
<ggole> Don't you load those with Dynlink?
<giselle> ggole: I don't know... I guess how to load them is my question.
WanderingGlitch has joined #ocaml
ygrek has quit [Remote host closed the connection]
<ggole> See the docs for the Dynlink module
<giselle> ok, thanks
ygrek has joined #ocaml
tristero has joined #ocaml
giselle has left #ocaml [#ocaml]
nojb has joined #ocaml
keen____ has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 256 seconds]
keen_ has joined #ocaml
<nojb> does the stdlib Hashtbl using pointer compare (==) as 'equal' function ?
<nojb> no it doesn't, it uses 'compare' ...
struktured has quit [Ping timeout: 264 seconds]
<ggole> Huh, not (=)?
keen_ has quit [Read error: Connection reset by peer]
keen_ has joined #ocaml
swgillespie has joined #ocaml
<nojb> yes, (=), in the form 0 = compare ? ?
MrScout has quit [Remote host closed the connection]
s1n4 has quit [Ping timeout: 265 seconds]
<ggole> I wonder if there's a reason for that
madroach has quit [Ping timeout: 264 seconds]
MercurialAlchemi has joined #ocaml
madroach has joined #ocaml
axiles has joined #ocaml
Denommus has joined #ocaml
Denommus has quit [Read error: Connection reset by peer]
Denommus has joined #ocaml
idem-pyon-tent is now known as pyon
mcc has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
Denommus has quit [Read error: Connection reset by peer]
<mcc> Hellos
Denommus has joined #ocaml
<mcc> oh, hm
<mcc> well i was gonna ask a question but i think the answer is ocamllabs ctypes
<mcc> i was gonna ask what to do if you want to bind to a c library but you don't have information about what you want to do until runtime, for example because you are a programming language interpreter
<nojb> you can use ctypes.foreign, look at the Foreign module
slash^ has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mcc> thanks. btw, is this just a libffi wrapper?
<mcc> if i find i'm writing a wrapper in my own language for ocaml-ctypes, would it make more sense to wrap libffi directly somehow...?
mcc has quit [Quit: This computer has gone to sleep]
gabemc has quit [Ping timeout: 255 seconds]
Denommus has quit [Read error: Connection reset by peer]
Denommus has joined #ocaml
tane has joined #ocaml
Denommus has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
axiles has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
ygrek_ has joined #ocaml
larhat has joined #ocaml
larhat has quit [Remote host closed the connection]
larhat has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
rand000 has joined #ocaml
luzie has quit [Quit: WeeChat 1.1.1]
luzie has joined #ocaml
luzie has quit [Client Quit]
luzie has joined #ocaml
luzie has quit [Changing host]
luzie has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
larhat has quit [Quit: Leaving.]
madroach has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
mort___ has joined #ocaml
deavidsedice has joined #ocaml
deavid has quit [Ping timeout: 246 seconds]
lordkryss has joined #ocaml
freling has joined #ocaml
pyx has joined #ocaml
pyx has quit [Client Quit]
rgrinberg has joined #ocaml
mengu has joined #ocaml
<nojb> is there a way to make ocamlbuild use ocamlmklib ?
rgrinberg has quit [Ping timeout: 255 seconds]
mengu has quit [Ping timeout: 272 seconds]
mengu has joined #ocaml
jbrown has joined #ocaml
bbc has quit [Quit: ZNC - http://znc.in]
nojb has quit [Quit: nojb]
bbc has joined #ocaml
olibjerd has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
bbc has quit [Quit: ZNC - http://znc.in]
rkat has left #ocaml ["Quitte"]
bbc has joined #ocaml
TheLemonMan has joined #ocaml
milosn has quit [Ping timeout: 272 seconds]
ingsoc has joined #ocaml
hilquias has joined #ocaml
kakadu has joined #ocaml
mort___ has quit [Quit: Leaving.]
ygrek_ has quit [Ping timeout: 244 seconds]
BitPuffin has joined #ocaml
shinnya has joined #ocaml
dav_ has joined #ocaml
ygrek has joined #ocaml
Nijikokun has quit [Ping timeout: 264 seconds]
dav has quit [Ping timeout: 250 seconds]
Nijikokun has joined #ocaml
AlexRussia has quit [Ping timeout: 246 seconds]
ingsoc has quit [Read error: Connection reset by peer]
freling has quit [Quit: Leaving.]
Nijikokun has quit [Ping timeout: 272 seconds]
Nijikokun has joined #ocaml
rgrinberg has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Ping timeout: 245 seconds]
rand000 has quit [Ping timeout: 250 seconds]
maurer has quit [Ping timeout: 252 seconds]
maurer has joined #ocaml
AlexRussia has joined #ocaml
milosn has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
milosn has joined #ocaml
Haudegen has joined #ocaml
wwilly has joined #ocaml
sdothum has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
leowzukw has joined #ocaml
milosn has quit [Ping timeout: 256 seconds]
nojb has joined #ocaml
milosn has joined #ocaml
dav_ is now known as dav
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
mort___ has joined #ocaml
<nojb> how do I link a native code library with a shared library ?
Choups314 has joined #ocaml
dav has quit [Ping timeout: 245 seconds]
milosn has quit [Ping timeout: 264 seconds]
dav has joined #ocaml
dav has quit [Ping timeout: 250 seconds]
zump has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
milosn has joined #ocaml
Nijikokun has quit [Ping timeout: 245 seconds]
<kakadu> nojb: -ccopt -lsomething?
<adrien> usually it's done automagically
<nojb> let me explain: I am writing a native library (.cmxa) that depends on C stubs (which I can put in a dll*.so or a lib*.a). I can't make it so that ocamlopt somehow links the C stubs into the cmxa ...
<nojb> If I pass the .a on the command line it says that it doesn't know what to do with them, and if I pass it using -l flag it compiles, but then when I try to use the .cmxa to compile a binary it complains that it can't find the lib*.a (clearly)
idegen has joined #ocaml
<adrien> are you doing it in the same way as shown at http://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.html#ref_linklib ?
thomasga has joined #ocaml
<nojb> adrien: let me check ...
<nojb> what is $< in a makefile ?
<nojb> adrien: brilliant ! I managed to do it with the help of that page ... thanks a lot.
<adrien> :)
<nojb> you needs to pass the -ccopt flags everywhere in order for it to work
wwilly has quit [Ping timeout: 250 seconds]
mort___ has quit [Quit: Leaving.]
<adrien> what happens is that the option gets recorded in the final cma (and cmxa maybe)
<adrien> so you need to provide it when creating it
<nojb> yeah I think I understand how it all works now - I was also confused for a while due to the differences between byte and native (shared lib for bytecode, static for native, etc...)
thomasga has quit [Quit: Leaving.]
ob_ has joined #ocaml
s1n4 has joined #ocaml
mrvn has quit [Remote host closed the connection]
wwilly has joined #ocaml
mengu__ has joined #ocaml
milosn has quit [Ping timeout: 256 seconds]
mengu has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
kakadu has quit [Ping timeout: 246 seconds]
struktured has joined #ocaml
shinnya has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
mengu has joined #ocaml
mengu__ has quit [Ping timeout: 250 seconds]
s1n4 has quit [Ping timeout: 264 seconds]
mort___ has joined #ocaml
kakadu has joined #ocaml
thomasga has joined #ocaml
mort___ has quit [Quit: Leaving.]
ygrek has joined #ocaml
axiles has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
darkf has quit [Quit: Leaving]
milosn has joined #ocaml
dav has joined #ocaml
mort___ has joined #ocaml
curiosity has joined #ocaml
A1977494 has joined #ocaml
med-amine has joined #ocaml
mrm has joined #ocaml
med-amine has left #ocaml ["Konversation terminated!"]
thomasga has quit [Quit: Leaving.]
<mrm> Hello! If someone's going to participate in Google Code Jam today (it's not too late: the Qualification Round ends in 10 hours), please take a look at the DSL that I released just now: https://github.com/cakeplus/pa_solution.
<mrm> It's a robust tool that already proved to be useful in several contests.
<mrm> Lots of usage examples: cakeplus.bitbucket.org/pages/sources/solutions/.
<mrm> The package should hit OPAM shortly.
javamonn has joined #ocaml
<curiosity> i recently started working with the redis binding. I want to upload a script to redis and read the sha1 digest it returns. but the return type is string IO.t, how can i read that string then?
Submarine has joined #ocaml
Submarine has joined #ocaml
<nojb> are you using lwt/async ?
<curiosity> nojb: lwt. Is there a redis binding for async?
<nojb> no idea - IO.t most surely refers to the Lwt monad, so that you have to bind the results with the >>= operator
<curiosity> thanks, so i need to call run on the return value to get the actual sha1?
nojb has quit [Quit: nojb]
<Drup> no, don't use run
avsm has joined #ocaml
<Drup> read the lwt documentation some more or use the blocking interface if you don't want the cooperative concurency: https://github.com/0xffea/ocaml-redis/blob/master/src/redis_sync.mli
<MercurialAlchemi> curiosity: essentially, if you use lwt, you stay in the lwt monad
s1n4 has joined #ocaml
javamonn has quit [Remote host closed the connection]
<curiosity> MercurialAlchemi: can i have a "normal" while loop accepting incoming messages, and creating lwt threads that handle the storage of that data on redis
javamonn has joined #ocaml
<Drup> use the syntax extension and you can have while%lwt which looks almost normal :p
rgrinberg has quit [Ping timeout: 255 seconds]
thomasga has joined #ocaml
larhat has joined #ocaml
Choups314 has quit [Quit: Leaving]
rgrinberg has joined #ocaml
Gama11 has joined #ocaml
dav has quit [Ping timeout: 240 seconds]
dav has joined #ocaml
dubosec has joined #ocaml
<dubosec> minor thing, but does anyone know why utop returns the type "bytes" for strings?
thomasga has quit [Quit: Leaving.]
ontologiae has joined #ocaml
<mrm> The package is on OPAM: http://opam.ocaml.org/packages/pa_solution/pa_solution.0.5/. If someone wants to try it in this round of CodeJam, I'm here to answer all usability questions.
<Drup> dubosec: they are equivalent
larhat has quit [Read error: Connection reset by peer]
<Drup> if you pass the option -safe-string, however, they are not and string is now immutable (and bytes is mutable)
<dubosec> oh, I didn't know that; good info
<Drup> it's a new and temporary solution
<Drup> at some point, safe-string will be the default
<Drup> mrm: I like the idea but I'm *really* not fond of the impletation
<Drup> why not just a combinator library ? It seems enough
<dubosec> so strings will be immutable unless the byte type is used, or am I misunderstanding that?
<Drup> dubosec: string will be immutable period. To do mutable byte arrays, you use bytes (and there are conversion functions)
<dubosec> oh, so strings and bytes will not be equivalent
<mrm> Drup: Why not? You can't implement an equivalently powerful abstraction without resorting to compilation. I've tried before doing it with monads and functors with no success.
<dubosec> that makes a lot of sense though: bytes as a character array basically and strings are immutable like lists
<Drup> mrm: what were the issues ?
<Drup> it seems very similar to a parser combinator approach, just with some syntactic overhead
<Drup> you are abusing the OCaml syntax in a rather non trivial way which makes reading and writing such parsers more difficult than it should be
<Drup> (also, camlp4, meh)
<Drup> (but that's really just on the side)
<ggole> mrm: hmm, interesting use of macros
BitPuffin has quit [Ping timeout: 276 seconds]
rand000 has joined #ocaml
hilquias has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
<mrm> Drup: The issue is that neither the module system, nor the monadic approaches are expressive enough to allow combining the parsers and printers in the required way, without imposing significant syntactic overhead.
rgrinberg has quit [Ping timeout: 255 seconds]
<mrm> By the way, I'm a heavy user of monadic parsing combinators (and the maintainer of the most popular parsec clone for OCaml).
mort___ has quit [Quit: Leaving.]
ontologiae has quit [Ping timeout: 276 seconds]
<mrm> Also, I don't see a problem with "abusing the OCaml syntax", as the problem domain involves repeatedly writing lots of tiny throw-away programs, and the introduced syntax can be memoized very quickly.
Submarine has quit [Remote host closed the connection]
swgillespie has joined #ocaml
<mrm> Be the way, even the mentioned monadic parsers benefit greatly from using a syntax extension (like pa_monad) to mitigate the pains of the monadic syntax.
<Drup> pa_monad introduces let!, right ?
mengu has quit [Read error: Connection reset by peer]
<mrm> Drup: it adds syntactic support for binding and chaining monads.
mengu has joined #ocaml
<Drup> yes, I know that, I'm asking which supports :)
<Drup> (also, which parsec clone ?)
<Drup> (ah, mparser, right)
<mrm> Now, for a concrete example: try to build an abstraction for parsing "tuples" with either monads or functors, without introducing tuple2, tuple3, ... tupleN.
<mrm> Right. It is long time the most popular combinator library on OPAM, with several known users.
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Drup> and I'm sorry not to buy the "I doesn't matter if the syntax is messy and confusing since it's used for thrown away programs" ;)
<Drup> It*
<mrm> I've used it with great success for parsing various industrial programming languages (Delphi, Java, C#), as well as implementing numerous embedded DSLs with proper support for quasi-quotation.
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 250 seconds]
<Drup> Stop acting like I'm attacking you. I'm giving you *my* opinion on your implementation choice. :p
mort___ has joined #ocaml
<mrm> Drup: In programming competitions, literally every second of time matters; so it's critical not to spend time fighting with printf/scanf or monadic combinators. And the syntax is not as confusing as it might seems. Actually, it's built on a set of minimalistic core principles.
<mrm> Drup: I'm very sorry if I seem like attacking. It's just that I'm a very chatty person :-)
s1n4 has quit [Ping timeout: 245 seconds]
rgrinberg has joined #ocaml
hilquias has joined #ocaml
dav has quit [Remote host closed the connection]
BitPuffin has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
mort___ has quit [Quit: Leaving.]
<Drup> now, your scaners are first class, you can compose them, you can create new ones for custom data structures and it's less than 10% in code size augmentation
<Drup> and the .mli would make it self documented
<Drup> you haven't given me compelling arguments that would make me prefer your solution with all it's camlp4 bloat over this one. ;)
<mrm> Good. This is very similar to what I came up with when using the monadic approach. Yet I'd like it to be even more concise, in a perl-style one-liner way.
<mrm> What's wrong with bloat if you won't need to support the resulting program? It's a write-once throw-away kind of application.
<Drup> well, it's not really monadic
<mrm> Making it supportable is not important (hence first-classness is not needed).
<mrm> It's applicative.
<Drup> yeah
<mrm> Because it doesn't need to backtrack.
<mrm> Very similar. Just not fun enough :-)
<Drup> that's really overkill xD
<mrm> Well, it did the job. I just didn't enjoy it enough.
matason has joined #ocaml
<Drup> aren't scanners composable ?
ygrek has quit [Ping timeout: 248 seconds]
<mrm> Now, almost every IO specification is a one-liner:
<mrm> They are.
<mrm> Grep for "Solution".
swgillespie has joined #ocaml
<Drup> "Solution (n: int64) (d, g: int) : string =" -> let n = int64() in let d,g = int(), int() in ...
<Drup> still pretty much the same
<mrm> How about that:
<mrm> Solution (w, h, p, q, n, x, y, a, b, c, d: int) : int64 =
swgillespie has quit [Client Quit]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<Drup> let [w; h; p; q; n; x; y; a; b; c; d] = list 11 int() in ...
<Drup> :D
<mrm> Ok :-D
<Drup> (ok, sketchy, I admit)
<rgrinberg> How does the new exception matching syntax looks like?
<rgrinberg> Can't find it in the manual
<Drup> rgrinberg: "match x with Bla _ -> .. | exception Exn -> ..."
swgillespie has joined #ocaml
<rgrinberg> Drup: thanks. I was close, tried exn Exn
<Drup> the exception keyword was already taken, so better reuse it :p
javamonn has quit [Remote host closed the connection]
<mrm> Drup: How about that:
<mrm> Solution (n: int) (classes: list[n] of let m: int in list[m] of int) : string =
<ousado> that's for exceptions raised in the match cases?
<Drup> ousado: no, in the match body
<Drup> mrm: see the original thing I posted
swgillespie has quit [Client Quit]
<Drup> it's pretty much the same
javamonn has joined #ocaml
<mrm> Drup: Yeah, trying to fit that into a oneliner.
<Drup> I fail to see virtue in the absence of newlines.
<Drup> but, heh, maybe that's just me. I tend to like maintenaible software. :D
<rgrinberg> oh I wish ocamlbuild used cmdliner :(
<mrm> Yeah, contest programming is in many ways like the opposite of industrial programming :-)
<Drup> rgrinberg: I really should do my plan of creating a library exposing cmdliner terms for all the ocaml tools
<mrm> See how my friend does it with C++:
<mrm> Everything below the header is generated code.
<ousado> horrible
<mrm> He wrote an intricate compiler that helps him to shave a couple of minutes from the time it takes to implement the solution.
<rgrinberg> Drup: please do it . and try and slap a @@deprecated on Arg
<Drup> mrm: "I didn't want to use a high level language, so I implemented an horrible high level language"
<Drup> >_>
<tane> lol
<Drup> I mean, the "solution" is pretty trivial to transform to valid ocaml.
<mrm> And he's really-really good at solving this kind of problems -- he even got to the CodeJam finals.
<mrm> Contest programming is a very alien world, really, with regards to the "best practices of industrial programming".
<Drup> OCaml would even compile quicker and may produce faster code.
<Drup> rgrinberg: I mean, externally of the compiler
<Drup> so if you want to build a custom OCaml compiler, which is pretty easy now
<Drup> you can use that.
<mrm> Drup: About compiling faster -- true. Not so true about performance. The majority of the top contest programmers use C++ not without a sound reason. It simply gets the job done in that domain.
<ousado> may I ask what "the job" is in context programming?
<ousado> err context
<ousado> err contest
<ousado> I can't even write it :)
<Drup> mrm: I personally it's just familiarity with C++, but ok.
<mrm> ousado: Often it is writing performance-sensitive code that deals with combinatorics.
<Drup> +think
<Drup> there are better languages out there for efficient perl programming
<Drup> I mean, your friend is not writing C++ code anymore anyway
<mrm> Often there are a lot of tight loops, and at the same time there are strict time constraints.
<mrm> Drup: Perl is useless for these kinds of problems, for performance reasons.
<tane> mrm, time levels are the same for all languages?
<Drup> mrm: I was talking of the programing style
<mrm> tane: true.
<mrm> Drup: Programming style does not matter at all in this domain. Noone reads the code except the compiler. The only thing that matters is that the tests pass.
<tane> sounds like bs then
<tane> especially if you can bring in your own prebuilt libraries
<mrm> So, it's a very-very niche "field".
<mrm> tane: You can't.
<Drup> mrm: in practice, what you want is perl paradigm, though
mv has quit [Remote host closed the connection]
<Drup> apparently
<mrm> tane: But in online competitions you can use your own compilers to generate code.
<Drup> I mean, your thing is perly, his is perly
<mrm> Drup: I want something that fits good in that particular, very niche domain.
avsm has quit [Quit: Leaving.]
<mrm> And yes, perly things fit good there.
<Drup> madness.
<mrm> APL things would fit great as well.
<mrm> Why madness?
<Drup> APL would be efficient
<Drup> I mean, it's pretty much killer for loops
<mrm> Support for intricate data structures is also very important, so pure APL is totally out of the question.
<mrm> Although it might make sense as a DSL.
<Drup> support for intricate data structures -- everyone uses C++
<Drup> I see a contradiction.
<Drup> :D
<mrm> True. C++ is by far not the greatest language for that, yet it's good enough in that particular domain, when abstract interfaces are unimportant.
<Drup> and nobody started using hyper-compilation for loop structures with one of the good polyedric model compilers ? :D I mean, being overkill and all that :D
<mrm> Top guys can quickly code stuff like flow network algorithms, and the code will look like total and utter shit, yet it will work, and will work fast enough.
<mrm> Drup: Unfortunately, not many of those guys write compilers. I know only a couple of them who do.
<mrm> And they aren't one of the very best, even with their crazy tools.
<mrm> The very-very best one for many years (Gennady Korotkevich) used to write his solutions in Delphi7, sometimes producing hundreds of LOCs per solution.
matason has quit [Quit: Leaving...]
<mrm> Yet he was always an outlier with regards to competitive results.
<mrm> So, it's a very weird "problem domain", yes :-)
Hannibal_Smith has joined #ocaml
idegen has quit [Remote host closed the connection]
<Drup> it's not about writing a compiler, just using the one wrote by others
<mrm> Which one? There is no existing DSL for solving these kind of problems.
<Drup> loops stuff ? are you kidding ?
<mrm> That's why my friend built his own compiler that produces C++.
<mrm> It's not simply "loops stuff".
<mrm> It's much more than that: combinatorics, number theory, graph algorithms, geometric problems, numeric methods, scheduling, data structures, etc etc etc.
<mrm> Let me show you some problem.
<mrm> This is a very-very difficult one. I haven't solved it, and almost noone did.
kakadu has quit [Quit: Page closed]
<mrm> As it turned out, finding a correct solution involved descending into the depths of several fields of computer science. Only one person got the picture right, in his mind, and constructed a working implementation.
Submarine has joined #ocaml
<mrm> Try to think about this for a while. I will then show you how it was solved (will give a link to the article).
<Drup> modified KMP algorithm ?
<Drup> that's how I would go, by intuition
<mrm> It's not, by far it's not.
<Drup> I must say I'm not very good at these kind of problems.
<mrm> Building a suffix automation was my approach, which failed miserably even in theory.
<mrm> Me too. I'll hardly make it to the second round. Don't have much experience with these.
<Drup> no, I mean, codejams in general
<Drup> I'm just not interested;
<mrm> If you wish, you can think more about the problem, for amusement purposes. If not, I will show you the answer.
<Drup> I see these weird ass contrive problem and I'm like "yeah, ok, but why should I spend time solving that" :|
<mrm> I thought about this one for two days.
<mrm> And didn't come even close to the core idea of the solution, which is like... totally unintuitive.
<mrm> Drup: For the fun of it.
<Drup> there are already enough problems around there that deserve solving without considering contrive and artificial problems like that
<mrm> Drup: For the very excitement of banging your head aganst a problem that someone has solved in less than an hour.
<Drup> but heh, I never was much into competition to begin with
<mrm> Drup: True. But some people have fun with exactly such kind of problems, being time-constrained and competing for internet points with each other.
<mrm> Ok, I'll show you the solution. It's fun.
<Drup> some researchers should do a tiny bit of work to formulate open algorithmic problems into codejam contests
<mrm> One person actually managed to figure this out in less than an hour (as well as to implement a working solution that hardly made it through tests without crossing the time limit).
<Drup> that would be useful.
<mrm> Drup: That's how it usually happends. Those who compose problems are often veterans of contest programmings who became professional computer scientists.
<mrm> *happens
<mrm> *programming
<mrm> At the same time, many great computer scientists don't give a shit about these "toy problems" and that's understandable.
<mrm> It's mostly popular in Russia and China, for historic and cultural reasons.
<Drup> no, I mean, you could create a toy problem from a non-toy problem to make participants find a solution to the non-toy problem :D
<Drup> there are a ton of graph problems that have no efficient algorithms
<mrm> Drup: Sometimes it actually happens so that some of the participants demonstrate surprising insight into the problem, the one that was unexpected by the jury.
<mrm> Take a look at that solution (I've posted the link). I believe one needs to have an genuine talent for computer science to be able to solve it during the competition.
<mrm> Or rather a talent for mathematics in general.
jonludlam has joined #ocaml
r0ok has joined #ocaml
leowzukw has quit [Remote host closed the connection]
javamonn has quit [Remote host closed the connection]
matason has joined #ocaml
kakadu has joined #ocaml
Submarine has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
oscar_toro has joined #ocaml
javamonn has joined #ocaml
jonludlam has quit [Ping timeout: 255 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
r0ok has quit [Quit: leaving]
mort___ has joined #ocaml
matason has quit [Quit: Leaving...]
Submarine has joined #ocaml
Submarine has joined #ocaml
javamonn has quit [Remote host closed the connection]
Submarine has quit [Remote host closed the connection]
javamonn has joined #ocaml
matason has joined #ocaml
javamonn has quit [Remote host closed the connection]
idegen has joined #ocaml
hilquias has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
Submarine has joined #ocaml
Haudegen has joined #ocaml
javamonn has joined #ocaml
thomasga has joined #ocaml
A1977494 has joined #ocaml
A19774941 has quit [Ping timeout: 252 seconds]
A1977494 has left #ocaml [#ocaml]
rand000 has quit [Ping timeout: 256 seconds]
pyon has quit [Ping timeout: 246 seconds]
<yminsky> bitemyapp: so, how should I use sandboxes for installing end-user packages? Should I mint a new directory somewhere for each new haskell package I want to install?
<yminsky> Whoops.'
<yminsky> wrong room, sorry.
rand000 has joined #ocaml
rand000 has quit [Client Quit]
psy_ has quit [Ping timeout: 240 seconds]
Submarine has quit [Quit: Leaving]
javamonn has quit [Remote host closed the connection]
pyon has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
javamonn has joined #ocaml
wwilly has left #ocaml ["Leaving"]
nojb has joined #ocaml
mort___ has quit [Quit: Leaving.]
c355E3B has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
javamonn has quit [Remote host closed the connection]
Nijikokun has joined #ocaml
javamonn has joined #ocaml
michatotol has joined #ocaml
dubosec has quit [Quit: Leaving]
Hannibal_Smith has quit [Remote host closed the connection]
axiles has quit [Remote host closed the connection]
Simn has quit [Quit: Leaving]
matason has quit [Quit: Later!]
<nojb> rgrinberg: ping ?
MercurialAlchemi has quit [Ping timeout: 250 seconds]
ggole has quit [Ping timeout: 252 seconds]
javamonn has quit [Remote host closed the connection]
matason has joined #ocaml
javamonn has joined #ocaml
javamonn has quit [Remote host closed the connection]
<nojb> where do I have to put the .install file so that opam picks it up ?
<Drup> root of project
<Drup> and it's opam.install
<nojb> but opam-publish is complaining because my opam file does not have a install field ?
javamonn has joined #ocaml
<Drup> ah, yes, that's different.
natrium1970 has joined #ocaml
<Drup> opam publish is really too strict about opam files
<Drup> try the opam publish dev version
<nojb> I'll check - thanks
<nojb> is it opam.install or <pkgname>.install ?
jonludlam has joined #ocaml
<Drup> pretty sure it's opam.install, check the manual
<nojb> it says NAME.install, so I guess it is not opam.install ...
<Drup> hum, maybe
tane has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
<nojb> can I omit the remove field if I have a .install file ?
<Drup> I don't think so and I'm not even sure opam will remove things for you anyway.
<nojb> no, actually one must omit the 'remove' field if one doesn't have an 'install' field (i.e. if one is using .install files)
<nojb> from the manual:
<nojb> - remove follows the same format as build, and is used to uninstall the package. It should be the reverse operation of install, and absent when install is.
Haudegen has quit [Ping timeout: 246 seconds]
<Drup> it doesn't say that opam registers the content in the foo.install and will properly remove it, though
<nojb> it doesn't, but it seems to explicitly say that if one uses .install file then one shouldn't include a 'remove' field, so...
<nojb> (this is from 1.2.3 in the manual)
rgrinberg has quit [Ping timeout: 250 seconds]
nojb has quit [Quit: nojb]
Haudegen has joined #ocaml
kakadu has quit [Remote host closed the connection]
javamonn has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
nojb has joined #ocaml
Gama11 has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
mcc has joined #ocaml
<mcc> Hello I am looking at integrating cppo into my project, i have finally been talked into it
<Drup> well talked.
<Drup> :D
<Drup> are you using ocamlbuild ?
mengu has quit [Remote host closed the connection]
natrium1970 has quit [Quit: natrium1970]
javamonn has quit [Remote host closed the connection]
<mcc> yes, i am trying to figure out how to configure it wrt my setup
<mcc> i just have one build line which is ocamlbuild -no-links -use-ocamlfind src/main.$(BUILDTYPE)
<mcc> and i have an src/tags
<mcc> i mean src/_tags
<Drup> that's quit easy
<mcc> i am looking at the readme
<mcc> they recommend -plugin-tag package(cppo_ocamlbuild) at command line
<Drup> yes
<mcc> i assume... i can just put package(cppo_ocamlbuild) in my _tags?
<Drup> ah, no, that's different.
<Drup> I don't think there is a tag for plugins
<Drup> (especially since a plugin can introduce new tags)
javamonn has joined #ocaml
<Drup> so, nope, just add the cmdliner argument.
<Drup> cmdline*
<mcc> haha ok
<Drup> (I wrote the plugin btw)
madroach has quit [Ping timeout: 264 seconds]
<mcc> oh! cppo?
<Drup> no, just the ocamlbuild plugin
<mcc> ah
<mcc> one more question
madroach has joined #ocaml
<mcc> readme lists some tags
<mcc> is there a way to specify tags at the command line?
<mcc> i am looking at the ocamlbuild docs http://nicolaspouillard.fr/ocamlbuild/ocamlbuild-user-guide.html having a surprisingly hard time finding, like
<mcc> a list of defined cmdline args
<Drup> according to ocamlbuild -help
<Drup> -tag <tag> Add to default tags
<mcc> o ok
<Drup> I'm not sure how that behaves with dynamically added tags, though.
<mcc> i am a LITTLE considering, instead of cppo, using whitequark's ppx_getenv
<Drup> it's not really the same usage
<mcc> however i'd want to extend it just a little
<nojb> mcc: what do you need it for ?
<mcc> well, the thing is i am using a subset of cppo's features
<Drup> getenv will never give you conditional compilation ...
<mcc> the only two things i want to do are (1) define constants in makefile such as COMPILETIME_PACKAGE_PATH AND (2) blank out sections of code based on makefile constants, potentially removing module dependencies
<mcc> getenv gets me 1 but not 2
<mcc> but it seems like ppx could in theory do 2...
jonludlam has quit [Quit: Leaving]
<Drup> don't forget ppx locks you in ocaml >= 4.02
<Drup> cppo doesn't
<Drup> (the restriction for cppo's ocamlbuild plugin can be easily lifted by copying the plugin in your own ocamlbuild.ml)
javamonn has quit [Remote host closed the connection]
<mcc> i'm already locked in ocaml >= 4.02 because i am using sedlex
<Drup> hum, ok.
<Drup> as you want, cppo is rather nice and lightweight and already all done ;)
<Drup> (btw, what did you do about arg ? :D)
<mcc> *nod* i'm integrating cppo
<mcc> but maybe i will reconsider later
<mcc> cuz i like HYGIENIC macros
<Drup> cppo is not hygienic ? :p
<mcc> well maybe i'm misreading that word.
<mcc> cppo still violates ASTs does it not?
<mcc> you can #define END )
<Drup> I mean, it only *removes* stuff, can't add any. How is that not hygienic ? :3
<Drup> ah, I see
<mcc> or you can say #ifdef WHATEVS \n ) #else X ) #endif
<mcc> it can add!! there are #define functions
javamonn has joined #ocaml
<Drup> hum, right substitute, ok.
<Drup> anyway, yes, it's on the text level, so pretty much yes
<mcc> basically, i am afraid that if i have access to CPPO, i will start writing #define functions and i DO NOT TRUST MYESLF WITH THAT.
<Drup> that much ?
<Drup> I mean, it's easy not to use that.
<Drup> I pretty much only uses it for #if ...
<Drup> to remove chunks of code depending of library availability and ocaml versions
nojb has quit [Quit: nojb]
<mcc> i will attempt to use self control
<Drup> :D
<Drup> Perlists anonymous
<mcc> this is EXACTLY the problem.
<Drup> "Hi, I'm mcc, today, I didn't wrote any $ in my code"
olibjerd has left #ocaml [#ocaml]
<mcc> also, re: Arg, you may be roll your eyes at this, but what i did was independently reimplement Arg :P and add the features i wanted https://bitbucket.org/runhello/emily/src/stable/src/argPlus.ml?at=default
<Drup> blarg
javamonn has quit [Remote host closed the connection]
<Drup> well, as I said, it's your time :D
<mcc> it was easy.... like 59 loc without comments...
<mcc> and some of that is implementing stuff cmdliner can't do (env vars)..
<mcc> ok so i put at bottom of main.ml "#error test"
<mcc> then i run: ocamlbuild -no-links -use-ocamlfind -plugin-tag "package(cppo_ocamlbuild)" src/main.native
<mcc> I get an error indicating cppo was not run: "This expression has type int, it has no method error)
nojb has joined #ocaml
<mcc> i also put cppo_ocamlbuild in the package() line in my _tags
<mcc> is any of this surprpsing?