<f[x]>
probably for the purpose of single-step debugging having up-to-date values in memory??
<edwin>
hmm the manual should definetely warn about that
<edwin>
oasis defaults to using -g too
<edwin>
and I think stdlib is compiled with -g too, isn't it?
<f[x]>
I always build all my code with -g for easy profiling
<adrien>
usually, yes
<adrien>
I also use -g all the time
<edwin>
f[x]: I get no differences with 3.12
<edwin>
on the generated assembly
<edwin>
ah hmm it matters if I put -g at the beginning or at the end?
<f[x]>
edwin, are you sure? I tested 3.12.1 too
<f[x]>
it is easy to see in -dlambda output too
<f[x]>
ha, -g is positional, didn't know
<f[x]>
put it at beginning
<edwin>
yeah I see the diff
<edwin>
and it gives no errors when you use it at the end :D
<edwin>
(makemutable 0 17)
<edwin>
this is the one I get with -g
<edwin>
instead of just 17
<f[x]>
yes, int ref is boxed
<edwin>
don't know if it is by design or a missed optimization
<edwin>
that is due to the (before 84-124 it misses some optimization
lamawithonel__ has joined #ocaml
lamawithonel__ has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
eb4890 has joined #ocaml
dnolen_ has joined #ocaml
Modius has quit [Quit: "Object-oriented design" is an oxymoron]
ikaros has joined #ocaml
dnolen_ has quit [Quit: dnolen_]
sepp2k has joined #ocaml
thieusoai has joined #ocaml
iratsu has quit [Ping timeout: 250 seconds]
Cyanure has quit [Read error: Connection reset by peer]
<thelema>
huh, type-conv is announced on the ocaml planet, but is permission denied on the forge
ulfdoz has joined #ocaml
iratsu has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ocaml
ankit9 has quit [Quit: Leaving]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
mouse has joined #ocaml
<mouse>
Hello. Can someone help me to do a supposedly simple thing with camlp4?
<mouse>
I have a parser, which takes a string as an input and gives back an AST.
<mouse>
I want to make a camlp4 quotation that would use this parser to print back AST using ocaml-data-notation.
<mouse>
So that <:myast< a + 12 >> would expand into (Ast.E_BINOP (Ast.OP_ADD (Ast.E_VAR a, Ast.E_LIT (Ast.L_INT 1))))
<mouse>
No need for antiquotations or precise location tracking for now
<mouse>
So, the first problem is: how to plug existing parser into camlp4?
<thelema>
I wish I could help, but my camlp4-fu is non-existent. @gildor?
<thelema>
gildor: ping
<mouse>
Oh. Gildor is the great guy who helped me last time with camlp4!
<mouse>
He is also the author of ocaml-data-notation
<thelema>
yup, that's part of why I think he'd be useful for this question.
<mouse>
So far I have found the source of camlp4 to be the best documentation :-)
<thelema>
I'm kinda confused at what you want, you want to be able to include magic strings in your code and have the parser function pre-process that string?
<mouse>
Unfortunately, it's very hard for me to comprehend it, as, being a novice, my OCaml-fu is still very weak.
<mouse>
Yeah
<mouse>
According to the old camlp4 tutorial, quotations can help me to solve this problem cleanly
<thelema>
i.e. you want `<:myast< foo >>` to be transformed into `(parse "foo")`?
<mouse>
It doesn't document how to plug in existing parser though
<mouse>
nope -- into a literal representation of ast
<mouse>
i want the parsing to be done on compile-time
<thelema>
fair enough. What's the output of your parser, a string?
<mouse>
input is a string. output is a structure -- an AST
<mouse>
i can print that AST using ocaml-data-notation
<mouse>
which is another syntax extention that allows to print structures using the syntax of OCaml literals
<mouse>
exactly what I need
ulfdoz has joined #ocaml
<mouse>
this kind of stuff is trivial to implement in Lisp using macros
* thelema
gives up on camlp4 again and goes back to his work
anxt has joined #ocaml
wormphlegm has joined #ocaml
wormphlegm has quit [Ping timeout: 276 seconds]
larhat has quit [Quit: Leaving.]
ruien has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
othiym23 has joined #ocaml
Anarchos has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
sepp2k has quit [Ping timeout: 255 seconds]
<adrien>
ocaml is supposed to be bad for graphical user interfaces, can anyone think of a _functional_ language that is good for GUI stuff?
<schmrkc>
adrien: Who says it is bad?
<adrien>
schmrkc: read that quite often, and never read anyone saying it was good
<thelema>
what language is good for GUI stuff?
<adrien>
the more I spend time on lablgtk and lablgtk-react, the more I think it's simply that we love functional stuff and current toolkits simply don't fit
<thelema>
there is a mismatch trying to fit a OO/imperative toolkit into a functional language
<adrien>
thelema: python, but then you better not care about highly reactive interfaces (they always lag a bit)
<schmrkc>
adrien: F# seems to integrate quite well with windows forms, and some scalaists claim that scala is functional and that works just fine with the java gui stuff.
<adrien>
yeah, this is why I was wondering if there was a functional programming language that made GUI programming nice, to see how it did
* schmrkc
shrugs and finds ocaml + gtk nice.
<adrien>
F#, right, I had to see that but had completely forgotten. As for scala, I had never read that, I'll see, thanks
<thelema>
or it could be that lablgtk sucks
<schmrkc>
But it usually comes down to the issue of the GUI toolkit design vs. functionalism like thelema pointed out.
<adrien>
thelema: care to expand (I'm geniously interested in your opinion)
<thelema>
adrien: on lablgtk sucks or on mismatch between it and ocaml
<thelema>
well, maybe they're the same thing
<adrien>
thelema: "lablgtk sucks", or is it "gtk sucks"?
<mouse>
what don't you like in labltk and lablgtk, adrien?
<mouse>
both seem to be stable and easy to use
<mouse>
perhaps you just don't like Tk and GTK?
<thelema>
probably more like lablgtk does its best to ocaml-ize the gtk library, but the design choices for gtk were for C, and quite incompatible with the OCaml way of doing things
<adrien>
no, I'm trying to make lablgtk better, I'm actually OK with it and it's the main option for GUI stuff in ocaml
<adrien>
thelema: ok, I mostly agree
sepp2k has joined #ocaml
<adrien>
what I find the most frustrating is probably when I have my wonderful code and data structures which are fast, efficient, take little memory, ... and I then have to use GTK which uses lists for everythign
<schmrkc>
adrien: I haven't actually poked around at it, but Racket has some GUI stuff iirc, and it used to be a scheme so it might be aiming to be functional.
<thelema>
lablgtk seems to try to keep the efficiency of gtk, which requires that the interface stay mostly the same, C-style
<adrien>
well, their logo has a lambda in it, I guess it's still functional, going to see
avsm has joined #ocaml
<schmrkc>
adrien: I'm quickly browsing the GUI manual and it seems to pretty much be GTK with () added :)
<adrien>
schmrkc: seems a bit higher-level, but not that much
<mouse>
adrien: take a look at cells-gtk, which is an interface library for Common Lisp. It uses an interesting model of "cells"
<ski>
adrien : another thing which could be interesting to look at is Fudgets
<thelema>
ah, I bet it does nothing, and makes sure that attaching text to the end of a conversion specification works out
_andre has joined #ocaml
<adrien>
mouse: it helps for _some_ cases by simplifying some steps but it doesn't help when you have your code split into the actual application and the display part and you need to take the output of one and feed it to the other
<mouse>
you are talking about frp :-)
<adrien>
which usually goes like "I have a tree of simple elements, I want to display them, how do I do that (with a treeview)?"
quiccker has quit [Read error: Connection reset by peer]
<thelema>
hcarty: does commit e09c469 fix your problem?
<adrien>
mouse: well, probably, and that's what I am currently doing but I want to keep an eye on alternatives to avoid going blindly into one direction and only liking it because I am used to it
<adrien>
"clean gui", not the right words for a search engine request ;-)
<mouse>
do you know of any production-ready frp implementation? (for any language/gui system)
<mouse>
something commercial maybe?
ygrek has joined #ocaml
<mouse>
something mature and not just a toy/experiment
<adrien>
there's frscheme but it uses tk and I think it hasn't been maintained/developped after its initial release (to be checked)
<adrien>
there might be something in F#/.net too (they have something "reactive", I think it matches but I haven't had time to take a deeper look at it, it's quite recent)
<ski>
(iirc the gui system was called "Objective I/O" or something like that)
andre__ has joined #ocaml
<ski>
(or maybe s/Objective/Object/)
andre__ is now known as Guest27792
<ski>
mouse : afaik, FRP is still open research
<mouse>
adrien: in search for interesting ideas you might as well take a look at some experimental web frameworks
<adrien>
and after that, most FRP (for ocaml: React among others, probably Concurrent Cells too) can be used with GUI stuff, what they lack is actualy integration to make the API nice (and that's what I'm doing)
_andre has quit [Ping timeout: 252 seconds]
Guest27792 is now known as _andre
Xaseron has left #ocaml []
<hcarty>
thelema: I'm off for a bit, but I'll check later this evening or tomorrow
eb4890 has quit [Read error: No route to host]
<mouse>
My brain explodes as I try to read camlp4 source
<mouse>
It is almost completely uncommented
<mouse>
Except for the authors names in the header of each file
<mouse>
As if they were asking for me to mail them my silly questions :-)
<adrien>
ski: Object/IO's tutorial is rather long, I think I won't be able to read it tonight (300 pages ;-) )
<mouse>
What is the point of having ";;" everywhere in source files?
<mouse>
Isn't that totally useless outside the toplevel prompt?
<adrien>
it can prevent syntax errors from being reported at the far end of the source file
<mouse>
it can prevent some error reporting bugs, you mean?
<thelema>
it can. Someone convinced me here that there was a downside worse than the help locating syntax errors, but I can't recall what that worse thing was
<mouse>
oh my. camlp4 is almost as gory as ocamlbuild
<mouse>
or so it seems to my untrained eyes
<thelema>
it can force the error to be located earlier - there's not exactly an error reporting bug
<adrien>
some syntax errors are reported at the end of the input (like missing parens, bracket, let/in), so ocaml can tell you "syntax error on line 100000" when the error is on line 1
<thelema>
it's just a limitation of the ocaml grammar that the first place that anything goes wrong is far away from the actual error
<adrien>
';;' will make it say "error on line 10" (where you put ";;") instead
<mouse>
i see it actually uses ocamlyacc for parsing
<mouse>
with lots of hacks to improve error reporting :-)
<adrien>
yeah, it's not an actual ocaml error until you have reached the end of the input, it's simply not what you probably meant ;-)
lopex has joined #ocaml
<mouse>
speaking of ocaml grammar, is there any point in using/not using the revised syntax?
<mouse>
i am not very familiar with the revised syntax, but original one drives me mad already with some of its quirks
ikaros has quit [Quit: Ex-Chat]
lamawithonel has joined #ocaml
<adrien>
biggest point is probably taste
<mouse>
What about tool support? Is there an Emacs mode which understands revised syntax?
<mouse>
wow -- whole camlp4 is only ~10k lines of code (counting lines in .ml files with ocamlwc)
<mouse>
not even nearly as huge as I have thought
lamawithonel has quit [Ping timeout: 250 seconds]
jamii has joined #ocaml
drunK has joined #ocaml
ygrek has quit [Remote host closed the connection]
Anarchos has quit [Ping timeout: 240 seconds]
Anarchos has joined #ocaml
avsm has joined #ocaml
lamawithonel has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
lamawithonel has quit [Ping timeout: 250 seconds]
lamawithonel has joined #ocaml
lamawithonel has quit [Read error: Connection reset by peer]
iratsu has quit [Quit: Leaving.]
lamawithonel has joined #ocaml
lamawithonel has quit [Read error: Connection reset by peer]
jamii has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
ygrek has joined #ocaml
avsm has joined #ocaml
_andre has quit [Quit: leaving]
avsm has quit [Quit: Leaving.]
lamawithonel has joined #ocaml
jamii has joined #ocaml
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 250 seconds]
edwin has quit [Quit: Leaving.]
lamawithonel_ has quit [Ping timeout: 250 seconds]
alfa_y_omega has quit [Read error: Connection reset by peer]
Anarchos has quit [Ping timeout: 252 seconds]
Modius has joined #ocaml
lamawithonel_ has joined #ocaml
avsm has joined #ocaml
<hcarty>
thelema: Does this mean that the printf format strings in Batteries are not checked (or not fully checked) at compile time?
mouse has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ygrek has quit [Ping timeout: 250 seconds]
<dsheets>
is there a way with menhir/ocamlyacc to capture the entire token matched by a rule instead of just its semantic part? That is, sometimes I don't want to unwrap the token-type data constructor.
avsm has quit [Quit: Leaving.]
lamawithonel_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
anxt has quit [Ping timeout: 240 seconds]
<hcarty>
thelema: Yes, that patch does appear to fix my issue, both using master and the patch applied against 1.3.0
<hcarty>
thelema: Thank you for the quick fix!
<hcarty>
Interesting tidbit - add .patch to the end of a github commit URL to get a raw patch for that commit
lamawithonel_ has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
lamawithonel_ has quit [Ping timeout: 250 seconds]
alexyk has joined #ocaml
jamii has joined #ocaml
lamawithonel_ has joined #ocaml
thermoplyae has joined #ocaml
lamawithonel_ has quit [Ping timeout: 250 seconds]