adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
NingaLeaf has joined #ocaml
NingaLeaf has quit [Client Quit]
NingaLeaf has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
tristero has joined #ocaml
madroach has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
mcmillhj_ has joined #ocaml
raphaelsss has joined #ocaml
iZsh_ has joined #ocaml
mcmillhj has quit [Ping timeout: 240 seconds]
raphaelss has quit [Ping timeout: 240 seconds]
Sorella has quit [Ping timeout: 240 seconds]
iZsh has quit [Ping timeout: 240 seconds]
Sorella has joined #ocaml
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
madroach has quit [Ping timeout: 248 seconds]
<_berke__> I have an oasis project with internal libraries; it rebuilds the libraries, but doesn't seem to recompile the executables that depend on it, although the executables have a BuildDepends: for that library
madroach has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
<Algebr``> are you positive that it isn't rebuilding? could check with stat
seangrove has joined #ocaml
mcc has joined #ocaml
NingaLeaf has quit [Quit: Textual IRC Client: www.textualapp.com]
pierpa has quit [Ping timeout: 264 seconds]
<_berke__> algebr``: just did. but maybe it's because the change was in the C stub of the library?
<_berke__> nope...
<_berke__> I have Executable blah with BuildDepends: foo, and then Library foo with module Bar
<_berke__> I change bar.ml, do make, it recompiles library, but doesn't rebuild the executable. hint: they are under different subdirectories
raphaelsss is now known as raphaelss
<_berke__> this is oasis v0.4.4 with ocaml 4.01.0
segmond has quit [Ping timeout: 260 seconds]
low-profile has quit [Ping timeout: 256 seconds]
<Drup> _berke__: and you regenerated the oasis file "recently" ?
low-profile has joined #ocaml
<Drup> the oasis generated files*
<_berke__> drup: I did an oasis setup today, but not immediately before the changes.
<_berke__> I'm trying to reproduce this problem in a toy project with the same layout but I don't see the bug. the tool is recompiled as expected. so oasis/ocamlbuild are doing what they are supposed to be doing. I will clean the real project and try again.
<_berke__> I nuked everything (_build, setup.*, Makefile, configure) but the problem persists
FreeBirdLjj has joined #ocaml
<Drup> can you pastebin your _oasis ?
<_berke__> sure just a second, needs some sanitization
segmond has joined #ocaml
Stalkr has quit [Quit: Leaving...]
Stalkr has joined #ocaml
<_berke__> the problem is with the cameralink module.
<_berke__> and the multi_call executable
<_berke__> I checked _build/_log and it rebuilds the cameralink library, but the executable is cached
Stalkr_ has joined #ocaml
<Drup> Are you sure you change .. actually changes something ?
<Drup> is the *.cm* don't change after compilation, ocamlbuild is not going to propagage
<Drup> propagate*
Stalkr^ has joined #ocaml
Stalkr has quit [Ping timeout: 245 seconds]
Stalkr_ has quit [Read error: Connection reset by peer]
Stalkr^ has quit [Client Quit]
<Drup> (Do the other executable depending on cameralink exhibit the same issue ?)
Stalkr has joined #ocaml
ygrek_ has quit [Ping timeout: 245 seconds]
Stalkr has quit [Client Quit]
antkong has quit [Quit: antkong]
sivoais has joined #ocaml
sivoais has quit [Ping timeout: 256 seconds]
sivoais has joined #ocaml
sivoais has quit [Ping timeout: 240 seconds]
copy` has quit [Quit: Connection closed for inactivity]
sivoais has joined #ocaml
ygrek has joined #ocaml
sivoais has quit [Ping timeout: 250 seconds]
pyx has joined #ocaml
pyx has quit [Client Quit]
avarsh has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Remote host closed the connection]
sivoais has joined #ocaml
<_berke__> drup: well the C code changes and it recompiles the library
<_berke__> so I added a printf() to the C code with a new string... definitely can't be optimized away. the .cmxs got updated. the object file for the C stubs got updated. but not the rest
<_berke__> if I change the .ml module that calls the C code, then things get rebuilt
<def`> Ah, it only uses the cmx digests to guide rebuilding.
<_berke__> in other words just changing cameralink_stubs.c doesn't cause the cameralink library or the tools that depend on it to be rebuilt
<def`> Too bad :P
The_Mad_Pirate has joined #ocaml
<_berke__> so it's more of an ocamlbuild bug?
sivoais has quit [Ping timeout: 260 seconds]
ygrek_ has quit [Ping timeout: 240 seconds]
<def`> I don't know oasis enough to tell.
mac10688 has joined #ocaml
<def`> and Drup is likely to be /away at this time.
antkong_ has joined #ocaml
jeffmo has quit [Quit: jeffmo]
<Drup> No I'm not away, yes it's an ocamlbuild problem
<def`> :)
<Drup> it could probably be fixed though, I'm not sure how much of the C building is in oasis generated myocamlbuild or inside ocamlbuild, either way, it's a regular rule, so you "just" need to adjust that
seangrove has quit [Ping timeout: 248 seconds]
virtualeyes has quit [Ping timeout: 240 seconds]
<_berke__> drup: ok thanks, maybe one day I'll look at ocamlbuild rules :)
badon has quit [Ping timeout: 256 seconds]
Guest77788 has quit [Ping timeout: 250 seconds]
badon has joined #ocaml
raphaelss has quit [Ping timeout: 250 seconds]
jeffmo has joined #ocaml
mac10688 has quit [Ping timeout: 240 seconds]
seangrove has joined #ocaml
kushal has quit [Ping timeout: 245 seconds]
seangrove has quit [Ping timeout: 276 seconds]
<teknozulu> Any hot tips for basically clearing opam, like doing a switch but keeping the same compiler
<teknozulu> (tldr manually poked around to do upgrades, but now core 113.24 was released and I just want a clean slate)
<Drup> teknozulu: switch to another switch, switch remove, switch install
<teknozulu> ty
jeffmo has quit [Ping timeout: 252 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
BitPuffin|osx has quit [Ping timeout: 240 seconds]
Guest77788 has joined #ocaml
seangrove has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
Guest77788 has quit [Ping timeout: 252 seconds]
seangrove has quit [Ping timeout: 272 seconds]
kushal has joined #ocaml
nkhodyunya has joined #ocaml
nkhodyunya has quit [Client Quit]
lokien_ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
govg has quit [Ping timeout: 245 seconds]
seangrove has joined #ocaml
govg has joined #ocaml
Guest77788 has joined #ocaml
MercurialAlchemi has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
ggole has joined #ocaml
Guest77788 has quit [Ping timeout: 260 seconds]
manizzle has joined #ocaml
avarsh has quit [Read error: Connection reset by peer]
ggole_ has joined #ocaml
tane has joined #ocaml
ggole has quit [Ping timeout: 276 seconds]
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 272 seconds]
govg has joined #ocaml
mcc has quit [Quit: Connection closed for inactivity]
ggole__ has quit [Ping timeout: 276 seconds]
seangrove has quit [Ping timeout: 250 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
teknozulu has quit [Ping timeout: 252 seconds]
antkong_ has quit [Quit: antkong_]
aantron has quit [Remote host closed the connection]
please_help0 has quit [Ping timeout: 250 seconds]
elfring has joined #ocaml
darkf has joined #ocaml
segmond has quit [Ping timeout: 252 seconds]
<reynir> Is it possible to get information about which version of the compiler was used to compile a binary?
<reynir> I'm using Unison, but one of the binaries were compiled with 4.02 or something and the bigarray layouts differ
zpe has joined #ocaml
yawnt has joined #ocaml
segmond has joined #ocaml
yawnt has quit [Changing host]
yawnt has joined #ocaml
dsheets has joined #ocaml
Guest77788 has joined #ocaml
Guest77788 has quit [Ping timeout: 240 seconds]
warp has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
ygrek_ has joined #ocaml
dsheets_ has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
dsheets_ has quit [Read error: No route to host]
dsheets has joined #ocaml
dsheets_ has joined #ocaml
Haudegen has joined #ocaml
jwatzman|work has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
dsheets has joined #ocaml
ggole has joined #ocaml
dsheets_ has quit [Ping timeout: 248 seconds]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
seangrove has joined #ocaml
ygrek_ has quit [Ping timeout: 250 seconds]
_andre has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
dsheets has quit [Remote host closed the connection]
Simn has joined #ocaml
zpe_ has joined #ocaml
dsheets has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
yawnt has quit [Ping timeout: 245 seconds]
silver has joined #ocaml
orbifx has joined #ocaml
<orbifx> elllo
<reynir> Hello orbifx
zpe_ has quit [Remote host closed the connection]
kakadu has joined #ocaml
The_Mad_Pirate has quit [Quit: Konversation terminated!]
<orbifx> hello Kakadu
<kakadu> hey
freehck has joined #ocaml
Guest77788 has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
Guest77788 has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
iosys has quit [Ping timeout: 264 seconds]
Ravana has quit [Ping timeout: 264 seconds]
theblatte has quit [Ping timeout: 264 seconds]
companion_square has quit [Ping timeout: 264 seconds]
cyraxjoe has joined #ocaml
thizanne has quit [Ping timeout: 264 seconds]
Xandaros has quit [Ping timeout: 264 seconds]
maker has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
cross has quit [Ping timeout: 264 seconds]
cyraxjoe_ has quit [Ping timeout: 264 seconds]
gargawel has quit [Ping timeout: 264 seconds]
jmasseo has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
companion_cube has joined #ocaml
theblatte has joined #ocaml
jmasseo has joined #ocaml
gargawel has joined #ocaml
vishesh has quit [Ping timeout: 250 seconds]
cross has joined #ocaml
mcmillhj_ has quit [Ping timeout: 250 seconds]
iosys has joined #ocaml
Ravana has joined #ocaml
vishesh has joined #ocaml
thizanne has joined #ocaml
Xandaros has joined #ocaml
maker has joined #ocaml
sillyotter has joined #ocaml
<Xandaros> Drup: I recompiled ocaml and lablgtk2 and it works now - thank you so much! :)
sillyotter has quit [Client Quit]
AlexRussia has quit [Quit: WeeChat 1.4-dev]
AlexRussia_ has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
seangrove has joined #ocaml
seangrove has quit [Ping timeout: 260 seconds]
freehck has quit [Ping timeout: 245 seconds]
virtualeyes has joined #ocaml
Stalkr has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
<johnelse> js_of_ocaml question: does anyone know a nice way of wrapping JS strings with ocaml variants?
<johnelse> from looking at https://github.com/ocsigen/js_of_ocaml/blob/master/lib/webSockets.ml#L21-L25 it seems variants get converting into JS ints
<reynir> Do you mean converting between JS strings and ocaml strings?
<johnelse> so there's a property which in javascript should only ever 'foo', 'bar' or 'baz'
<reynir> ah nvm, just clicked what you meant with 'variants' :)
<johnelse> I'd like to have an ocaml type like | Foo | Bar | Baz which maps to this
<johnelse> or [< `foo | `bar | `baz ] also works - I'd just like to avoid exposing it as a Js.js_string at the API level
BitPuffin has joined #ocaml
<johnelse> I could just define let foo = Js.js_string "foo", but it's not ideal :)
phrst has joined #ocaml
dsheets has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 248 seconds]
tane has quit [Quit: Verlassend]
wabawaba has joined #ocaml
pierpa has joined #ocaml
<wabawaba> is there a way to pattern match on a type, e.g. match foo with | MyType a... where encapsulates the WHOLE of MyType (e.g. if MyType takes 4 args)
<wabawaba> I don't want to put MyType (a, b, c, d), just a for the whole thing
<theblatte> match foo with | MyType _ -> (* stuff *) ?
<wabawaba> theblatte: I think I tried that but it still errors because it needs 4 arguments?
<theblatte> no you didn't :)
<ggole> wabawaba: if you want to just ignore all of them, _ will work for any number of args (except zero).
<pierpa> and then what would you use this for?
copy` has joined #ocaml
<ggole> If you want to use them as a tuple you are out of luck - although you could change the definition of the data type so that the arguments are a 4-tuple
<wabawaba> pierpa: if it's recursive I can't put MyType(MyType(MyType a,b,c,d) a, b, c, d) a,b,c,d)
<wabawaba> well, I don't want to anyway
malc_ has joined #ocaml
Sorella has joined #ocaml
madroach has joined #ocaml
<pierpa> but, either you need to name the components, or you don't. If you need the names than you can't escape the need to name them. If you don't need the names, use _
wabawaba has quit [Ping timeout: 252 seconds]
seangrove has joined #ocaml
Guest77788 has joined #ocaml
infinity0 has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
Guest77788 has quit [Ping timeout: 264 seconds]
seangrove has quit [Ping timeout: 252 seconds]
AlexRussia_ has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
tane has joined #ocaml
<Drup> johnelse: I don't see any other way
<Drup> Xandaros: Good! Now you only have to learn enough OCaml to clean up the mess :D
<Xandaros> Drup: Hah, no thanks. I'm staying in my little haskell world :P
<Xandaros> I might rewrite the thing, though. I do want to augment it a littleto make it actually useful, anyway
<Drup> If you know haskell, picking up OCaml is very quick :p
<johnelse> Drup: thanks, I don't think so either :) I thought there might be a way of inserting a pair of marshalling/unmarshalling functions, but it doesn't seem like there is
<Drup> johnelse, oh, you want marshalling ?
<Drup> that's completely different :D
<Drup> Marshall works on js
<johnelse> oh? :)
<Drup> (there is also ppx_deriving)
<Drup> I mean, marshalling is not for pretty printing, I though you wanted pretty printing
<johnelse> ideally I want "type t = | Foo | Bar | Baz", and then "method x : t Js.t Js.prop"
<johnelse> and have Foo translate to "foo" without having to expose machinery in the API to do the conversion
<Drup> ah, I see
<Drup> No, you can't do that :/
<johnelse> heh, fine :P
JacobEdelman has joined #ocaml
<johnelse> thanks though, I will try and find a nice way of doing this without too much extra code
govg has quit [Read error: Connection reset by peer]
govg has joined #ocaml
<Drup> johnelse: personal advise as far as js FFI goes: don't expose the object FFI. It's meant as an internal layer. Add something more ocaml-y on top of it
<johnelse> sounds good, I've been having a look at ocaml-c3 for ideas
seangrove has joined #ocaml
seangrove has quit [Ping timeout: 245 seconds]
Stalkr has quit [Quit: Leaving...]
Habibutsu has joined #ocaml
raphaelss has joined #ocaml
<Habibutsu> Hi All, can somebody help me. I would like to build simple project, that used 'postgresql'. Here http://paste.ofcode.org/bWSsarPaRkqD5VbLzgnfVF my opam file and here http://paste.ofcode.org/f7Sm4FvZBqAzxQ3XC24X7a - Makefile. When i try to run 'ocamlbuild' i getting follwoing error: 'Missing -thread or -vmthread switch' (details http://paste.ofcode.org/sj7W6VRadfm9k8YMTMiuWi). What wrong?
<Drup> what's in your _tags ?
lokien_ has joined #ocaml
<Habibutsu> '_tags' what is this?
<Drup> It's supposed to be a file you have in your project
<Drup> Can you show the whole project ?
<Habibutsu> I did not create this file. Project is very simple and consists of three files - here gist for it https://gist.github.com/habibutsu/93705b0651168c1be085
Stalkr has joined #ocaml
<Drup> right, the makefile is not the one you posted before.
<Drup> Habibutsu: add the option "-tags thread " in the ocamlbuild invocation
<Drup> (and ffs, please change the default target to be built, I almost killed someone when it tried to init opam and pin a package when I did "make")
<Habibutsu> Yep, it worked. Thanks
madroach has quit [Ping timeout: 248 seconds]
Stalkr has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
octachron has joined #ocaml
madroach has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Guest77788 has joined #ocaml
Guest77788 has quit [Ping timeout: 240 seconds]
seangrove has joined #ocaml
kakadu has quit [Quit: Page closed]
warp has quit [Quit: I'll.. be back... https://i.imgur.com/KYU8vSO.gif]
warp has joined #ocaml
raphaelss has quit [Ping timeout: 248 seconds]
raphaelss has joined #ocaml
nkhodyunya has joined #ocaml
aantron has joined #ocaml
raphaelss has quit [Ping timeout: 240 seconds]
malc_ has quit [Quit: leaving]
warp has quit [Quit: I'll.. be back... https://i.imgur.com/KYU8vSO.gif]
warp has joined #ocaml
shinnya has joined #ocaml
MercurialAlchemi has joined #ocaml
srcerer_ has joined #ocaml
foolishmonkey_ has joined #ocaml
JacobEdelman has quit [Quit: Connection closed for inactivity]
apache2_ has joined #ocaml
wagle_ has joined #ocaml
ang has joined #ocaml
<ang> The answer here http://stackoverflow.com/questions/19340661/this-expression-has-type-unit-but-an-expression-was-expected-of-type-int says if/else must return same type. Can you return an int, and the else call a function that returns an int?
madroach has quit [Ping timeout: 248 seconds]
<aantron> ang: yes
<aantron> an int and applications of a function that results in an int are both expressions that have type int
<ang> okay, thank you
madroach has joined #ocaml
govg has quit [Ping timeout: 256 seconds]
apache2 has quit [*.net *.split]
srcerer has quit [*.net *.split]
foolishmonkey has quit [*.net *.split]
lyxia has quit [*.net *.split]
wagle has quit [*.net *.split]
sheijk has quit [Ping timeout: 272 seconds]
sheijk has joined #ocaml
ang has quit [Quit: Page closed]
orbifx has quit [Quit: WeeChat 1.3]
lyxia has joined #ocaml
demonimin has quit [Remote host closed the connection]
slash^ has joined #ocaml
sepp2k has joined #ocaml
AlexRussia_ has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
madroach has joined #ocaml
warp has quit [Ping timeout: 245 seconds]
octachron has quit [Quit: Leaving]
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
_andre has quit [Quit: leaving]
Habibutsu has quit [Quit: Page closed]
raphaelss has joined #ocaml
wagle_ is now known as wagle
kolko has joined #ocaml
sepp2k has quit [Quit: Leaving.]
nopf has joined #ocaml
Anarchos has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
govg has joined #ocaml
orbifx has joined #ocaml
dsheets has quit [Remote host closed the connection]
jeffmo has joined #ocaml
manizzle has quit [Ping timeout: 276 seconds]
raphaelss has quit [Quit: Leaving]
<orbifx> can ocaml do something equivalent to haskell's `where`, to have the main expression first and sub-expressions later?
<aantron> (fun v -> v + 1) (subexpression) :p
nkhodyunya has quit [Quit: Leaving.]
<aantron> but really i think not. you could abuse let rec ... and ... for this maybe, but there are restrictions
<aantron> ive used let rec ... and ... to get "logical" presentation order instead of for recursion in the past
<aantron> wonder if there is a ppx version, given that ocaml is arcing away from camlp4..
ygrek_ has joined #ocaml
<mrm> aantron: I don't think this can be done with ppx, and also hope that a genuine successor to Camlp4 will soon appear.
<Drup> You mean, a genuine successor that breaks all the tooling again ? Not gonna happen
<mrm> Drup: Nope -- a genuine successor that plays with tooling much better than Camlp4 does, by means of tight integration with the IDE/editor backend.
<mrm> I'm working on such a design right now.
<Drup> Ok *shrug*
<mrm> Camlp4 is an abomination, by the way. Saying this as a very experienced user.
<Drup> I know
<mrm> I'm confident that a syntax extension layer could be much more simple _and_ powerful at the same time.
<Drup> but neither fan, camlp5 or others are any better when it comes to tooling
<Drup> And I have yet to see a system that is decent in other languages
<Drup> (while allowing merlin-level things)
<ggole> Didn't caml light have where?
<Drup> mrm: ahahah
<Drup> yeah, no.
<Drup> please.
<mrm> Drup: I know it is stinky java crap, yet it is a working proof of concept.
<Drup> It's proof that it sucks
<Drup> I did a full language with it, I know
<mrm> It shows that it's possible to generate both the compiler frontend and an IDE backend at the same time.
<Drup> except you basically have to code the IDE at the same time
<Drup> it's nowhere near what we have now with merlin + ppx
<mrm> And I haven't used it for anything real, apart from examining hello-world-level example programs.
<Drup> Xcode is good only on paper on small examples, it's horrible to do anything non trivial with it
<mrm> Yes, but I think it is possible to simplyfy that part significantly, by describing all aspects of the language (parsing, printing, indentation, syntax highlighting) in a simple declarative language.
<Drup> (Also, it relies so much on introspection it would make your eyes bleed)
<mrm> Xcode is an ugly _framework_. What I think of is a language.
<mrm> I think of statically compiled solution.
<Drup> then it won't work with the current tooling
<mrm> From a single description it would produce both a compiler frontend and an emacs mode (or maybe a visual studio plugin).
<mrm> At the moment I experiment with producing Emacs modes.
<Drup> I mean, it's great in theory, but it means you will need to hotplug it somehow in the existing tooling. I don't care if you "produce emacs mode", I'm not going to change my configuration to use lwt.syntax
<Drup> (or other small things)
<Drup> I have my tooling that is very good already (merlin, ocp-index, ocp-indent, ...)
srcerer_ is now known as srcerer
<Drup> I wouldn't want that even for eliom, and it's exactly the right target (big extension of the language)
<mrm> Drup: I'm not a big fan of the current tooling. It's a collection of cludges.
<Algebr``> Drup: for me the only thing left is a nice debugger, I'm hopeful about this lldb usage for native code
<mrm> And, by the way, any emacs mode (like tuareg) is, similarly, a collection of ugly hacks.
<Drup> Yes but I didn't list tuareg in my list
<Drup> that was on purpose
<Drup> (I barelly use tuareg anymore, only for colors, the rest is handled by other tools)
<mrm> I'd like to derive everything from a single description. Yes, at the moment there is no practical demonstration of this alluring concept. But I'm working on it, and the problems get solved (even if much slower than I would desire).
<Drup> My remark is more than the problem is badly formulated, because even if you have a solution to that, that's not what most (ocaml) users want
<mrm> Well, there is something I want :-)
<mrm> And it's nowhere to be found.
<Drup> Fair enough
<Drup> what would you use it for, though ?
<Drup> Algebr``: and codoc
<mrm> I'd like to use static metaprogramming in a much more agressive way. Being able to define human-friendly notations is an important tool when using this approach.
<Drup> which kind of metaprogramming ?
<mrm> So, I'd like to have _both_ N-staged code generation _and_ support for syntactic abstraction.
<Drup> (the word is too overloaded, it can means many things)
<mrm> Implementing (as a compilers) custom, highly-specialized languages (with their own syntax), and integrating them seamlessly into the host language.
<Drup> So you want agda syntax flexibility + meta ocaml
<mrm> I can't do this efficiently with Camlp4, because of the various limitations of this tool (caused by design issues).
<Drup> There are languages that do that
<Drup> scala can do that, in particular
<mrm> Drup: You talk about mixfix notation?
<mrm> I'd like to have something more powerful.
<Drup> Yes
<mrm> I'd like to define languages by arbitrary PEGs.
<Drup> the difference is not very large
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<mrm> It is large, for just about any of my use cases.
<mrm> One moment, phone...
<Drup> Ah ? I mean, agda's lexer can already lex pretty much anything you throw at it (assuming you put spaces)
<Drup> "The warning not to flock comes too late, unfortunately. There are already three GtiHub stars." <3
kushal has quit [Ping timeout: 272 seconds]
nkhodyunya has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
CoolerVoid has quit [Quit: Saindo]
teknozulu has joined #ocaml
<mrm> Drup, my main field of interest is compilers and software transformation systems. A simple example of a syntax extention that requires proper support from the editor are anti-quotations for various structures (e.g. pieces of programming language syntax). Here is a screenshot of my prototype in action: https://imgur.com/v18PxVl.
<mrm> As you see, I intertwine Java and OCaml code in a single file, yet would like to have proper language-specific text editor support inside those delimited quotation regions.
<mrm> And this is only a very simple example where the sub-languages are delimited explicitly.
<orbifx> mrm is that extension for `where` yours?
<mrm> My prototype is extremely buggy so far. You can see a syntax highlighting bug inside "let byreference".
kansi has joined #ocaml
<mrm> orbitz: No. I simple packaged it once it was orphaned from Batteries.
<Drup> mrm: how is the java part typed/compiled ?
JacobEdelman has joined #ocaml
<mrm> But if you have any issues with it, do not hesitate reporting to the bug-tracker.
<mrm> Drup: Of course.
kushal has joined #ocaml
<mrm> The patterns are also types.
<mrm> *typed.
<Drup> mrm: "how" ;)
<mrm> Oh, _how_...
<mrm> Sorry :-)
<Drup> nop
<mrm> Drup: Well the java AST is lifted into a quite scary OCaml AST. And the type error messages are scary, yes. Especially because I make use of polymorphic variants.
<Drup> ok, so it's all lifted to OCaml AST
<mrm> Unfortunately, yes.
<Drup> Can't you have all what you want with simple a ppx [%java {| .... |}]
<Drup> simply*
<mrm> In this simple example, where everything is delimited -- yes I can. But I won't get text editor support.
<Drup> It doesn't work in general, but if it's lifted to OCaml AST, it does
<orbifx> I like keeping dependencies down as a principle. Changing the order of expressions is good, but not at that "cost"
<Drup> mrm: merlin will work
<mrm> Drup: How will know about the Java syntax?
<mrm> I need at least syntax highlighting and indentation.
<Drup> It doesn't, merlin applies the ppx
<Drup> Oh, highlighting and indentation is another problem
<mrm> And an extremely important one.
<Drup> but, tbh, that's the easy part
<mrm> Simply quoting languages is possible with Camlp4 as well.
<Drup> Yeah, it's important, but that's the level 0 of tooling
<mrm> And how would you solve it?
<mrm> I try to generate this level of support from the very same syntax description that is used by the compiler (syntax extension).
<Drup> Right, ok, so the confusion comes from the fact that we are talking about different kind of tooling
<mrm> Yes. My main problem with Camlp4 is that it's impossible to create syntax extensions that would play well with the text editor.
<Drup> well, for camlp4, nothing works
<Drup> you want lexer-level tooling
<mrm> For example, I don't use the mentioned above pa_where extension, because it fucks up highlighting and indentation.
<kansi> i don't know how to put this, but when does one need to async over lwt and vica-versa. a little insight into normal practices would be helpful
<Drup> I'm talking about AST walkers, which covers ocp-index/grep and merlin, you want
<Drup> -you want
<mrm> Drup: Ah. Yes, I'm primarily talking about syntax abstraction.
<mrm> By the way, I have my own tools for AST rewriting.
<Algebr``> kansi: they are two concurrency libraries, pick the one better suited for you. If you use core, then async is a natural choice
<mrm> I dropped an example recently. One moment...
<Drup> kansi: this is opinated; but kinda gives an answer http://rgrinberg.com/blog/2014/12/11/abandoning-async/
<Drup> ahah, I like how the URL gives the opinion away :D
<mrm> Drup: http://pastebin.pl/view/6d9ffb00. Seek "Traverse".
<mrm> This is a sub-language for defining rewrites over tree-like IRs.
<Drup> mrm: $_$
<mrm> Yeah :-P
<Drup> (sorry, it's an easy joke)
<Drup> mrm: ppx_tools has the same thing
<mrm> See, it sucks without proper highlighting.
<mrm> Drup: It's not even nearly as powerful. The rewriter in ppx is merely an OOP-style visitor.
<mrm> In my case, the rewrite is optimized.
<mrm> I can also do things that are difficult or impossible to do with visitors.
<Drup> What I'm talking about is not the visitor
<mrm> For example, I can do bottom-up and top-down traversals at the same time, expecting those _waves_ to meet.
Haudegen has quit [Ping timeout: 260 seconds]
<Drup> the creation/destruction of pieces of ast is an orthogonal problem to the kind of walking you are doing
<mrm> Drup: I've seen it and tested it. So far it's not even as good as the one from Camlp4 (which sucks).
<mrm> There are countless problems with deconstructing and splicing lists, for example.
<mrm> Many syntactic elements are unsupported.
<mrm> I tried making use of it in sedlex, as a test drive: https://github.com/alainfrisch/sedlex/pull/32.
<mrm> It will get better with time, of course. No doubts about that.
<Drup> I think you see what you mean ... I consider that a good thing. No more "<< x ; y >>" in middle of some code and you realize by reading the context that it's actually the middle of a list, and not an expression
<Drup> You only have "complete" pieces of OCaml AST
<mrm> Drup: I'd like to do stuff like this:
<Drup> (Didn't know you were cakeplus :D)
<mrm> match ast with <:d_stmt< $var:(id)$(a, b, $(rest)$...) >> -> ... making use of [rest] ...
<mrm> This is a simple example of list deconstruction.
<mrm> I'd also like to splice lists:
<mrm> <:d_stmt< $var:(id)$($(args)$..., $(more_args)$..., $(last_arg)$) >>
<Drup> is that supposed to be a tuple ?
<mrm> That funky $_$... syntax is for sequences.
<mrm> I get a list from a tuple :-)
<Drup> yeah
<Drup> Why not just use ... the actual language ?
<mrm> It can't be a tuple in OCaml, because we can't know the arity statically.
<mrm> To use raw ADTs?
<mrm> They're HUGE.
<mrm> I have lots of metadata attached there.
<Drup> Well no, you can mix normal patterns and AST patterns ..
<kansi> Drup the link pretty setteled it for me ... thx for the help :)
<mrm> Drup: Still very tricky. Those ADT nodes are totally uncomprehensible. There are lots of auto-generated constructors and fields, for example. The quasi-quote compiler knows how to hide this stuff.
foolishmonkey_ is now known as foolishmonkey
<Drup> I can write [%expr let%patapouf [%p? Tuple (h :: t) ] = [%e? some_exp]]
<Drup> bits of AST patterns, bits of OCaml patterns
<Drup> The syntax is disgusting, but so is yours :D
<Drup> Mine has the goodpoint that merlin still works and can tell me the type right in the middle of the pattern matching, if I ever want it to
<mrm> Yes, but pattern matching of OCaml is not very powerful, actually. For example, it can't match lists like this:
<mrm> <:d_stmt< $var:(id)$(a, $(some_more_args)$..., last_arg) >>
<Drup> Indeed
<mrm> More interesting example:
<Drup> I'm not saying your thing is bad btw, I'm just saying that the cost is too high
<mrm> Sometimes I'd like to consider certain expressions (sub-trees) isomorphic. For example, if we deal with associative and commutative binary operators.
<Drup> (And the syntax is even more terrible than ppx :D)
<Drup> I would prefer first class patterns in the language ...
<mrm> I'd like the pattern for a + 0 to match 0 + a :-D
<Drup> mrm: that is evil
<mrm> In such cases I use normalizing patterns.
<mrm> Drup: It's good if you have control over it.
<Drup> I feel like a good amount of your issues would be solved with first class patterns
<Drup> Anyway !
<Drup> when is the runtime stuff merged ? :D
<mrm> Drup: But this was only a very simple example -- an example of a fully-delimited language extension. And I'd like to do things that become ugly unless you meld the new constructs into the language seemlessly.
<mrm> Drup: Haha :-P. Well, I've implemented something (one of the solutions that I proposed), but it needs some more love (and testing!). And I'm procrastinating on IRC right now because I'm sooo muuuch daaamn tiiiired.
orbifx has quit [Quit: WeeChat 1.3]
Haudegen has joined #ocaml
<mrm> I also wanted to brew chicken soup. Too lazy for that... :-(
Mirry has joined #ocaml
BitPuffin has quit [Ping timeout: 272 seconds]
nuuit has joined #ocaml
<mrm> NO! I'm not lazy! That whining above was merely a minute weakness. In truth, the very thought of brewing that chicken soup fills me with determination. By the power of sheer will, I lift my body from the very comfortable chair and begin my gastronomic crusade.
ggole has quit []
kakadu has joined #ocaml
kansi has quit [Ping timeout: 272 seconds]
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
Mirry has quit [Quit: leaving]
yawnt has joined #ocaml
lokien_ has joined #ocaml
manizzle has joined #ocaml
manizzle has quit [Ping timeout: 250 seconds]
slash^ has quit [Read error: Connection reset by peer]
exm has left #ocaml [#ocaml]
larhat has joined #ocaml
govg has quit [Ping timeout: 245 seconds]
yawnt has quit [Quit: leaving]
koshmar has joined #ocaml
<seangrove> Hey all, I'm trying to find an experience with OCaml (my own project) and especially with js_of_ocaml that's close to this (what I'm used to working in) https://youtu.be/KZjFVdU8VLI?t=2m2s
<seangrove> What's the *closest* I can get with js_of_ocaml right now to that workflow?
<seangrove> e.g. save my ocaml file, have js_of_ocaml immediately (and incrementally) recompile it, and push it to my live-running app
<copy`> You could write a Makefile, use something like https://github.com/quackingduck-archive/reload-browser to reload the page and run `watch -n1 make`
<seangrove> copy`: Yeah, thought that might be the current approach
infinity0 has quit [Ping timeout: 276 seconds]
infinity0 has joined #ocaml
<seangrove> Thanks, I think I can do that for now and wok my way closer towards a figwheel-like setup
<seangrove> How do people edit web servers? I want to define a new route and have the code just update without requiring a restart/recompile cycle
nkhodyunya has quit [Quit: Leaving.]
<mfp> seangrove: there's also omake -P
Anarchos has joined #ocaml
<Drup> seangrove: important note: jsoo's compilation is *not* incremental.
<Drup> (There is a ticket to have separate compilation, hhugo seems interested to do it, but nothing is done for now)
nkhodyunya has joined #ocaml
nkhodyunya has quit [Client Quit]
nkhodyunya has joined #ocaml
zaquest has quit [Ping timeout: 256 seconds]
elfring has quit [Quit: Konversation terminated!]
larhat has quit [Quit: Leaving.]
manizzle has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
nkhodyunya has joined #ocaml
nkhodyunya has quit [Client Quit]
<kakadu> I have some problems with existantionals. How should I store 'a t where 'a is any type and abstract? https://paste.in.ua/1303/#10
mac10688 has joined #ocaml
<aantron> this looks dubious. if you need to cons to the list like that, is it possible to have 'a var_storage instead?
<kakadu> I want to put `int logic`, `string logic` and others to the single list
<kakadu> type 'a logic = Var of int | Value of 'a * ('a -> string)
<kakadu> call_fresh created (Var something) and I want to store this vars for using later
nkhodyunya has joined #ocaml
<aantron> well this existential type wont do that anyway
<kakadu> s/created/creates/
<aantron> "intuitively" it "means" for a single, but "unknown", type 'a, an 'a list
<aantron> sorry, 'a logic list
nkhodyunya has quit [Ping timeout: 260 seconds]
<aantron> to give a more "operational" intuition, you could wholly replace what is in fact an int list with a string list in that field, but it would be a homogenous list. you still could not cons a string to an int list
teknozulu has quit [Ping timeout: 252 seconds]
axiles has quit [Remote host closed the connection]
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
ollehar has joined #ocaml
jeffmo has quit [Quit: jeffmo]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Haudegen has quit [Ping timeout: 248 seconds]
pierpa has quit [Ping timeout: 248 seconds]
groovy2shoes has quit [Quit: Leaving]
antkong_ has joined #ocaml
silver has quit [Quit: rakede]
tane has quit [Quit: Verlassend]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
teknozulu has joined #ocaml
groovy2shoes has joined #ocaml
Haudegen has joined #ocaml
Simn has quit [Quit: Leaving]
nkhodyunya has joined #ocaml
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
linswd44 has joined #ocaml
<linswd44> Hi. I am lookingt for some help with my OPAM upgrade stopped working. Error:
<linswd44> - ocamlbuild.0.9.0 is not available because your system doesn't comply with ocaml-version >=
<linswd44> "4.03".
<linswd44> I am at 4.02.3. Apparently there is no longer ocamlbuild for this version and bunch of other packages depend on it!
<aantron> what packages did opam say it is upgrading?
nkhodyunya has quit [Ping timeout: 252 seconds]
<linswd44> here is the full message: http://ideone.com/01uh0Z
<aantron> this doesnt look like an error
<linswd44> but it looks like it won't be upgrading these packages anymore and in fact wants to downgrate them
<linswd44> I wanted to reinstall some package because of compilation error I am getting elsewhere:
<linswd44> and /Users/lord/.opam/4.02.3/lib/batteries/batString.cmi
<linswd44> make inconsistent assumptions over interface BatEnum
<aantron> its saying that there are versions of those two packages for newer compilers, and then, separately, for the big list below, some could be upgraded, if it werent for constraints that prevent it
<linswd44> ah, OK. that sounds better :) What do you suggest I do about batteries issue below?
<aantron> but none of those conditions are errors, unless you really want to get a certain version of a package
<linswd44> I want to OPAM to see if I can upgrade the batteries package
<aantron> what comes before the "and" in your error message?