gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
<ousado> ah it uses camlp4o
<dsheets> yeah
<dsheets> one of the design goals of atdgen was to make the data structure format more language-neutral if i understand correctly
<dsheets> I'd be interested in atdgen if I could use it under js_of_ocaml and it supported similar capabilities
<dsheets> I haven't investigated it, though, as json-tc already did what I wanted
<ousado> I see
<dsheets> I think it generates OCaml code, though, so js_of_ocaml shouldn't be a problem. Of course, I haven't actually tried it yet. :-/
<ousado> yes, it does, just reading the introduction
<ousado> on the client-side, do you use a validating JSON parser or the native browser ones?
emmanuelux has joined #ocaml
<dsheets> well, as soon as i get running under js_of_ocaml, i can use the validating parser for development clients. For the webheads who dislike generated js or the size, they can use the native browser one.
<ousado> yes.
<dsheets> I don't yet know how the json parsing will play out. If you look at https://github.com/ashima/gloc/blob/0.1/glo_lib.ml you will see i have implemented optional zero fields to make the format more concise. I have to figure out how to mimic this behavior with atdgen if I migrate to that
sebz has joined #ocaml
<dsheets> hmm it looks like atdgen supports default field values out-of-the-box
roconnor has joined #ocaml
<ousado> unfortunately I didn't have enough time yet to really make use of js_of_ocaml, and haxe does pretty well so far, but I'd like to integrate the two with each other
<dsheets> i've never really used haxe but i worked quite a bit with ocamljs before it was deprecated
<dsheets> I think js_of_ocaml's ocaml toplevel + haxe + api bindings and tools like gloc could be really sweet
<ousado> yes, I think so
<ousado> haxe as a language is a bit.. hm raw and unpolished, but it has great features like its macros
<dsheets> interesting. i will have to look into haxe's metaprogramming
<ousado> also it's young and the community is small, and the main developer is very much open to suggestions and ideas
<ousado> and for me as someone fairly new to hacking compilers, language and type theory etc. I see great potential for learning
<dsheets> yes, i am new to this as well and quite nervous for some enlightenment from those more experienced in compiler design and software distribution
<dsheets> i would like to emit low-garbage javascript from webglsl shader source and get some nice ocaml module generation happening so i can write high performance numeric apps for web browsers in ocaml and glsl alone
<ousado> yeah.. option-pricing for the web.. hehe
<dsheets> also, i am plotting a crusade to open up the test suites for the shading language which are behind a $10k+ paywall right now
<dsheets> ousado: option pricing is amenable to simd?
<ousado> yes, very much so
<dsheets> monte carlo or something?
<ousado> I mean, not every model out there.. yes, for example
<ousado> there are some demos on the nvidia webside for their CUDA stuff
<ousado> I'm not really into all that simd / graphics stuff, but I implemented some option pricing models a few years ago, and I remember well how we started that thing to let it run over night...
<ousado> I didn't follow up on it, though. was for the diploma and a phd thesis of a friend
<dsheets> ah, i wasn't very interested in it until i noticed the standards body victimizing the developer population by specifying stupid things in the language
<ousado> heh, that's a pretty strange reason to enter a field ;D
<dsheets> also, i'd like to build modern mathematical structures for GLSL and fix their broken type system
<dsheets> I was a developer as well but not really interested in the graphics or the games. I did do a few demos: http://ashimagroup.net/demo/
<dsheets> the math and meta-math interests me more, though, and i simply cannot abide broken languages
<ousado> is that you speaking?
<dsheets> in the videos? nah, that's the ceo :-P
<ousado> ah
<ousado> yeah, I remember that ooman demo. I showed it to some "we-will-never-surrender-to-anything-else" flash-devs
<dsheets> heheh. how'd it go over?
<ousado> well, they didn't say much after I showed them, I think it was a bit of a shock
oriba has quit [Quit: oriba]
<ousado> but it looks like I have insufficient driver support here..
<ousado> meh linux and graphics
<dsheets> gpu vendor? only nvidia isn't blacklisted
<ousado> ATI.. the hardware should be sufficient
<ousado> it's a 3 year old lenovo w500
<dsheets> if you are using a chrome-ish browser, you can try —ignore-gpu-blacklist cmd line option
<ousado> ah I see
<ousado> ok will try that after I cleaned up
<ousado> have like 150 tabs open again ;)
<dsheets> we have the same disease!
<ousado> yeah.. i already started writing a chrome extension, but didn't get too far as of now..
<dsheets> I really wish that browser's understood traversal graphs and automatically coalesced subtrees and tabs with shared keywords
<dsheets> I tried a TabManager extension for chrome but its interface wasn't magic enough so i never used it
<dsheets> and recently i've turned a little cold on the chrome/chromium projects entirely
<dsheets> I doubt Google's continued benevolence and their open source projects and developer relations are pretty poor.
<ousado> me too
<dsheets> I've had relevant comments on the chromium.org blog censored in favor of letting blogspam comments through
<ousado> wow
<ousado> frankly, I think there's a great lack of judgment and awareness WRT web development at google
<dsheets> I've seen many, many secret issues in "open source" projects and rewriting of revision history
<ousado> like dart
<dsheets> hahahaha
<ousado> I have no idea how they could pull off something like that in times of type inference
<dsheets> they weren't paying attention to their studies
<dsheets> and they fail to grasp the gravity of their decisions when it comes to web tech — they treat tool and platform development just like application development so when they save 2 days of dev time by taking a shortcut, they create 20000 days of distributed debug time over the next decade
<ousado> yes, my impression, too
<ousado> I used e.g. GWT for some time
<dsheets> it's very disrespectful. they then turn around and tell me that they "don't have the manpower" to fix conformance problems in their software while i develop a test suite and source transformer on a shoestring that takes advantage of those unimportant features
sebz has quit [Quit: Computer has gone to sleep.]
<dsheets> to add, you know, little things like modularity and dynamic linking to a language they claim is an "Open Web Standard"
<dsheets> how was GWT? broken?
sebz has joined #ocaml
<ousado> interesting
<ousado> GWT?
<ousado> oh horrible
<ousado> compiling hello world in GWT takes as much time as a 1,000,000 LOC project in haxe
<ousado> (well, that's a rough estimate)
<dsheets> O_O implemented in java for java->js?
<ousado> yes
<dsheets> sad. they are pushing their broken language implementations for webgl in C++ and JS now
<ousado> it has a massive infrastructure, eclipse plugins a "devmode" that lets app-devs use familiar java debugging..
<ousado> but it's totally flawed, not usable for everyday web development
<dsheets> only "serious business" web development? like gmail or something?
<dsheets> projects that actually need modularity and a legit type system? :-P
<ousado> nah.. I'm not even sure there's a single well known google app written in GWT
<ousado> all those are based on their js stuff, as far as I'm aware
<dsheets> yes, with great compiler like closure-compiler implemented in… java!
<ousado> the idea was to enable java app devs to write GUI-style apps for the web without knowing the first thing about web development
<dsheets> (signed and faxed a license agreement to them for a 2 byte bugfix)
<ousado> what the heck
<ousado> sounds like german bureaucracy
<dsheets> first and last time i contribute to that project
<ousado> wow.. that's pretty bad
<dsheets> also, google code is evil as a way to legitimize google's outsized control on their "open source" projects
<ousado> yes.. I always had that feeling, but I never got involved enough to verify
<dsheets> particularly allowing secret issues that are not security related is appalling
<ousado> also google groups is nasty
<dsheets> yes, i always give up on communities that use google groups
<ousado> I click on a link from some IRC chat, and they give me a login form
<ousado> oh,, ouch
<ousado> haxe migrated just now ..
<dsheets> to google groups or from google groups?
<ousado> to, unfortunately
<dsheets> :-( what about ocaml forge? not ocaml-specific enough?
<ousado> I don't know whether they even tried
<ousado> and I'm not sure there's much awareness on those issues
<ousado> most members are quite young game devs there
<ousado> haxe has been used mostly as alternative to AS3 targeting the flash platform
<dsheets> yes, when i looked at it a few years ago it looked like a way to write-once and run in flash and server-side in php
<dsheets> and as i didn't like those platforms, i didn't dig much deeper
<ousado> yes, currently there are C++, neko (a very nice lua-like VM), ABC bytecode, JS, PHP and C# targets
<ousado> JVM is in the pipeline
<dsheets> only later did i find out its metalanguage is ocaml
<ousado> but not all are high-quality
<ousado> neko is very nice, takes many ideas from ocaml
<ousado> like the 31bit integer model
<ousado> and the C interface is similar, too
<dsheets> interesting. there is so much to read about and so little time :-/
<ousado> indeed
<ousado> some 240h days per week would be cool
<ousado> I use neko to interface libevent and the upcoming and rewritten http library on top of it
<dsheets> i want some kind of personal research agent that reduces my flail-time by tracking what info i consume and doing some inference and speculative retrieval… could get a couple more hours/day of research done that way, maybe
<ousado> that's quite a business model
<dsheets> haxe http library?
<ousado> no, libevent
<dsheets> you think there is a business there?
<ousado> they had http support before, but some guy did a new one
<ousado> I'm not sure actually
<dsheets> ah, i see. i have been using lwt+cohttp
<ousado> yes, I'd have used that, but my ocaml isn't snappy enough yet
<dsheets> ah. what timezone are you in if you don't mind my asking?
<NaCl> thelema: I think I may end up using s-expressions
<ousado> .. and since I'm a little under pressure, I have to go for the stuff I know best
<ousado> oh, it's 4:09 AM here
<ousado> I live in germany
<dsheets> ok. maybe i'll have to come to europe, all the cool programmers seem to live there
<ousado> heh
<ousado> well, come to europe, it's nice
<ousado> not necessarily because of the programmers, though
<dsheets> ousado: perhaps if SOPA/PIPA passes… it was nice chatting but it is time for dinner here :-)
<ousado> dsheets: cool, yes, nice again, actually
<ousado> see you then
<dsheets> see you :-)
buriedhead has joined #ocaml
mdelaney has joined #ocaml
buriedhead has quit [Ping timeout: 248 seconds]
upgrayeddd has joined #ocaml
pilki has joined #ocaml
buriedhead has joined #ocaml
<thelema> dsheets: you can auto-install many packages (with deps) with odb it'll be easy for people if your library is installable with odb.
<Drakken> thelema that viewport prob is fixed now. One of the archimedes devs helped me with it.
mdelaney has quit [Read error: Connection reset by peer]
mdelaney has joined #ocaml
roconnor has quit [Ping timeout: 260 seconds]
fantasti` has joined #ocaml
fantasticsid has quit [Ping timeout: 244 seconds]
buriedhead has quit [Ping timeout: 240 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
fantasti` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
fantasticsid has joined #ocaml
Cyanure has quit [Remote host closed the connection]
buriedhead has joined #ocaml
sebz has joined #ocaml
ulfdoz has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
mdelaney has quit [Ping timeout: 268 seconds]
mdelaney has joined #ocaml
ankit9 has quit [Quit: Leaving]
philtor has quit [Ping timeout: 240 seconds]
emmanuel_ has joined #ocaml
emmanuelux has quit [Write error: Connection reset by peer]
emmanuel_ has quit [Remote host closed the connection]
pilki has quit [Quit: Leaving]
everyonemines has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
buriedhead has quit [Ping timeout: 268 seconds]
ankit9 has joined #ocaml
mdelaney has quit [Ping timeout: 240 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
Snark has joined #ocaml
taupin has joined #ocaml
sebz has joined #ocaml
sebz has quit [Client Quit]
pango is now known as pangoafk
sebz has joined #ocaml
Kakadu has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 276 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
dsheets has quit [Ping timeout: 240 seconds]
cago has joined #ocaml
dsheets has joined #ocaml
edwin has joined #ocaml
dsheets has quit [Ping timeout: 248 seconds]
everyonemines has quit [Quit: Leaving.]
Xizor has joined #ocaml
_andre has joined #ocaml
ikaros has joined #ocaml
<adrien> moin
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
yroeht has quit [Ping timeout: 248 seconds]
milosn has joined #ocaml
yroeht has joined #ocaml
thizanne has quit [Ping timeout: 268 seconds]
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
thizanne has joined #ocaml
Cyanure has joined #ocaml
<adrien> inside a module, is there a good way to have a function called on when the module is not used as a library?
<adrien> so the function can be used like "M.f arg" or ./m.native some_arg ?
joewilliams has quit [Excess Flood]
joewilliams has joined #ocaml
<flux> call a function of a module when no functions the module is not called? quite a concept..
<flux> the 'closest' you can get is Sys.interactive (iirc) for detecting toplevel sessions
letrec has joined #ocaml
<adrien> I wanted to make a module that could be used both standalone and as a library but I guess I'll skip the standalone part
zorun has quit [Quit: leaving]
zorun has joined #ocaml
zorun has quit [Quit: leaving]
zorun has joined #ocaml
zorun has quit [Client Quit]
zorun has joined #ocaml
<edwin> if anyone is using the syntastic plugin for Vim: it just gained OCaml syntax checking support!
zorun has quit [Client Quit]
zorun has joined #ocaml
<flux> ooh
<flux> too bad those need to be extended separately for syntax extensions
pilki has joined #ocaml
<flux> it's not a real hindrance, though ;)
fraggle_laptop has joined #ocaml
<edwin> well its using camlp4o now
<edwin> guess you could customize it somehow
<flux> oh, in that case it probably would easily work with extensions as well
<flux> pretty nifty
<edwin> to pass it parameters
<edwin> the checker for C allows you to define header include dirs and preprocessor params: https://github.com/scrooloose/syntastic/blob/master/syntax_checkers/c.vim
<edwin> or hmm it'd be nice if ocamlbuild could be used in a syntax-check only mode
<edwin> since usually ocamlbuild already knows how to preprocess the files
<adrien> edwin: sounds really neat; do you have examples/screenshots?
<edwin> I only added a basic syntax checker for OCaml, because it was missing completely
<edwin> basically when you save the file you get those '>>' markers on the lines that have syntax errors
<edwin> and if you type :Errors you can see the messages, and the window stays open until you fix them all
<edwin> and in gvim you got the bubbles, but I usually only use terminal, so not something for me
<edwin> hmm will have to experiment with ocamlbuild *.pp.ml
<adrien> edwin: is it able to get anything about types? the C example shows a warning for the type of main
zorun has quit [Quit: leaving]
zorun has joined #ocaml
zorun has quit [Client Quit]
zorun has joined #ocaml
<edwin> adrien: if I run ocamlc -i -o /dev/null then yes, but then I also get errors about 'Unbound module ...'. Thats why I'm looking into using ocamlbuild for ths
<adrien> right :-)
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
milosn has quit [Ping timeout: 252 seconds]
<rwmjones> gildor: pa-do (delimited overloading) isn't in debian .. or am I just overlooking something very obvious?
<thelema> rwmjones: I'd say you can build with odb, except I get an error about inconsistent assumptions over camlp4_import when compiling it.
<thelema> maybe there's something funny about my ocaml build
<adrien> rrrr
pilki has quit [Quit: This computer has gone to sleep]
<adrien> I think it's not the first project I have issues with ocamlbuild/oasis and C stubs
<rwmjones> I really just want to know if pa-do is in debian
<adrien> ocamlbuild doesn't catch changes to my C stubs I think
<adrien> definitely doesn't help debugging
ankit9 has quit [Ping timeout: 240 seconds]
<thelema> rwmjones: ok, n/m then. btw, good job packaging bitstring - I've found tons of ocaml packages that can't do a simple (configure) make; make install
milosn has joined #ocaml
<edwin> I don't think that pa-do is in Debian, I can't find it
<edwin> adrien: ok I think I got syntastic with ocamlbuild working, want to try?
<adrien> edwin: in a few minutes I think
<adrien> I need to maybe fight ocamlbuild and then merge a git branch and push again (not a lot of work)
<edwin> adrien: I pushed the ocamlbuild changes to my fork https://github.com/edwintorok/syntastic
emmanuelux has joined #ocaml
<edwin> You just need to enable it like 'let g:syntastic_ocaml_use_ocamlbuild = 1' in .vimrc
<flux> rwmjones, I checked unstable, and it seems it doesn't have pa_do
<flux> or any relevant package containing a file name matching pado or pa.do
<rwmjones> thanks
<rwmjones> that's what I thought too
<rwmjones> an unusual omission
<rwmjones> the reason is that pa-do doesn't compile on OCaml 3.12.1
<adrien> edwin: ok, I'll try it
<rwmjones> and I was wondering if debian had patched around this or not
<rwmjones> guess I'm going to have to talk to christophe
<adrien> edwin: btw, do you thikn that displaying the prototype of functions would be possible?
<edwin> adrien: I think Vim already knows how to read .annot files
<edwin> let me find what the key mapping is
<adrien> edwin: ah, right, I had fogotten about it
<edwin> but yeah I should tell ocamlbuild to build annots
<edwin> adrien: its mapped to <Leader>t
<adrien> I mostly had lablgtk and other big libraries in mind and not really the current projects but it's true it would be nice too
<NaCl> adrien: s-expressions!!!!
<adrien> NaCl: real s-expressions or something like them?
<NaCl> something that can be parsed with a stack
<adrien> weird, I thought that lablgtk2 generated .annot files
<adrien> NaCl: I was asking because there's Sexplib for them
<NaCl> yes
<NaCl> adrien: except if I use s-expressions, someone else here may be able to understand them quickly, thus ocaml may not "help" in the long run
<adrien> hmmm
<adrien> the Marshal module and a generator written by hand? :-)
<adrien> (you can be sure noone will understand :-) )
<edwin> adrien: ok now it writes .annot by default too, -tags native,annot did the trick. ocamlopt -annot -i writes .annot, ocamlc -annot -i doesn't
oriba has joined #ocaml
<adrien> that's weird
<edwin> I think ocamlc terminates early
<edwin> but ocamlopt runs the compiler further because it needs the lambda code always
Xizor has quit []
<adrien> maybe do -i and -annot in two separate calls?
avsm has joined #ocaml
<edwin> well if I do -annot it also compiles
<edwin> hmm guess I could tell it to compile a .cmi
<NaCl> adrien: I have recieved a Blessing.
<NaCl> adrien: slackbuilds. do you have them?
<adrien> NaCl: for what?
<adrien> and \o/ ;-)
<NaCl> use sexplib and ocaml
<NaCl> for this small project
<adrien> NaCl: ocaml is already on sbo and I haven't made sexplib
<NaCl> or type-conv
* NaCl is doing them
<adrien> look for OCAMLFIND_DESTDIR
<NaCl> oh.
<NaCl> that
* NaCl remembers that from RPM
Kakadu has quit [Quit: Page closed]
iago has joined #ocaml
ChristianS has joined #ocaml
dest has joined #ocaml
milosn has quit [Ping timeout: 245 seconds]
ulfdoz has joined #ocaml
cago has quit [Quit: Leaving.]
milosn has joined #ocaml
dest has left #ocaml []
mbac has quit [Ping timeout: 268 seconds]
dsheets has joined #ocaml
avsm has quit [Quit: Leaving.]
mbac has joined #ocaml
Kakadu has joined #ocaml
<Kakadu> Qrntzz: hi!
dsheets has quit [Ping timeout: 255 seconds]
<Qrntzz> Kakadu: hi
<Qrntzz> Kakadu: sorry, not being online much of the time, got some RL things to do lately
<Kakadu> Qrntzz: OK
<Qrntzz> Kakadu: so what are we up to? moc code? what needs to be discussed in detail?
<thelema> any suggestions on efficient representation of sets of sets of ints (DFA states as sets of NFA states)
<Kakadu> Qrntzz: You was going to study moc code...
<Qrntzz> Kakadu: I did
oriba has quit [Remote host closed the connection]
buriedhead has joined #ocaml
dsheets has joined #ocaml
<Kakadu> Qrntzz: and now we should make a little tools which connects C++ API with ocaml API
<Kakadu> which will generate some C++ class code and some OCaml code where we'll put buisness-logic
Drup has joined #ocaml
letrec has quit [Ping timeout: 245 seconds]
buriedhead has quit [Quit: Leaving.]
mdelaney has joined #ocaml
sebz has joined #ocaml
<Kakadu> Qrntzz: Does Ocaml should know about some specific for qml classes (to have full cow power for development)?
<Qrntzz> Kakadu: err, QML specifics? such as?
<Kakadu> I don't know... :D
<Qrntzz> lol
<Qrntzz> ok
<Qrntzz> Kakadu: which part of the work should I do exactly? (just so we don't work on the same thing simultaneously)
<Kakadu> hmmm
raichoo has joined #ocaml
<Kakadu> Qrntzz: Do you have any ideas what moc's input file format to use?
<Kakadu> One class with many methods or many classes with many methods inside?
<Qrntzz> Kakadu: I tend to like many classes with many methods more
raichoo has quit [Quit: Lost terminal]
dsheets has quit [Ping timeout: 248 seconds]
raichoo has joined #ocaml
<Kakadu> Qrntzz: what method's argument should be available?
<Kakadu> string + int + double
<Kakadu> and maybe List<T>
<Kakadu> I'm going to fix input file parser
dsheets has joined #ocaml
Drakken has quit [Ping timeout: 260 seconds]
<Qrntzz> Kakadu: yes
pangoafk is now known as pango
mdelaney has quit [Quit: mdelaney]
_andre has quit [Quit: leaving]
mdelaney has joined #ocaml
<Kakadu> Qrntzz: I've fixed parser for input file with API a bit. pull plz
mdelaney has quit [Client Quit]
<Qrntzz> Kakadu: ok
fraggle_laptop has quit [Remote host closed the connection]
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ikaros has quit [Quit: Ex-Chat]
ftrvxmtrx_ has joined #ocaml
Snark has quit [Quit: Quitte]
Cyanure has quit [Remote host closed the connection]
sebz has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
dsheets has quit [Ping timeout: 240 seconds]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
NihilistDandy has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn_ has joined #ocaml
edwin has quit [Remote host closed the connection]
Xizor has joined #ocaml
oriba has joined #ocaml
<adrien> gah, yet another bug because ocamlbuild didn't rebuild my C stubs
caligula_ has joined #ocaml
Drup1 has joined #ocaml
companion_square has joined #ocaml
samposm_ has joined #ocaml
iago has quit [Quit: Leaving]
ftrvxmtrx_ has quit [*.net *.split]
Drup has quit [*.net *.split]
samposm has quit [*.net *.split]
caligula__ has quit [*.net *.split]
rwmjones has quit [*.net *.split]
companion_cube has quit [*.net *.split]
samposm_ is now known as samposm
rwmjones has joined #ocaml
ftrvxmtrx_ has joined #ocaml
Morphous_ has quit [Ping timeout: 276 seconds]
<adrien> with C stubs, I'm doing the following and it reliably triggers a crash:
<adrien> CAMLlocal1(ml_message);
<adrien> ml_message = caml_alloc_tuple(4);
<adrien> Store_field(ml_message, 0, Val_int('a'));
<adrien> fprintf(stderr, "%d\n", Tag_val(Field(ml_message, 0)));
<adrien> I tried with 'a' instead of Val_int('a')
<adrien> and I have no idea what the issue would be
<adrien> on an example value (same type as "ml_message), in the topilevel, I get that Obj.tag (Obj.field (Obj.repr t) 0) = 1000
<adrien> also, if I replace Val_int with caml_copy_int32, I can properly get the tag
Morphous_ has joined #ocaml
Dettorer has joined #ocaml
Xizor has quit []
emmanuelux has quit [Ping timeout: 240 seconds]
wmeyer has quit [Ping timeout: 240 seconds]
emmanuelux has joined #ocaml
wmeyer has joined #ocaml
<adrien> well, I'm still stuck; if someone wants to look at this reproducer: http://vpaste.net/LNGWE
<wmeyer> adrien: s/Int_val/Val_int/
<adrien> acutally: http://vpaste.net/pKha4 with some more spaces, comment, and s/Int_val/Val_int
<adrien> :P
<wmeyer> lol
<wmeyer> still does not work?
<adrien> but it's still crashing and I didn't have it in my actual code (it's getting late and I'm making mistakes)
<wmeyer> it should be fine
<adrien> if I s/Val_int/caml_copy_int32/ it works
<adrien> but otherwise it crashes
<wmeyer> hm what is your ml signature>
<wmeyer> ?
<wmeyer> you can look here: https://github.com/danmey/elfoncaml/blob/master/src/Elf_stubs.c and draw some ideas, there are some nice macros.
<adrien> the .ml file is at the top of the .c file; you'll notice that ml_foo is unit -> unit
<wmeyer> ah yes
<adrien> also:
<adrien> # tag (repr (fst (42, 42l)));;
<adrien> - : int = 1000
<adrien> (that's with Obj opened)
<wmeyer> hmm Tag_val(Field(ml_message, 0))
<wmeyer> that does not name sense with Val_int
<wmeyer> make*
<wmeyer> because Int is 31 bit integer value and not block
<wmeyer> least significant bit is always 1
<wmeyer> so the blocks have zero and they are always aligned
<wmeyer> (that's why they have zero)
<adrien> I thought about it but I don't understand:
<adrien> # tag (repr 42);;
<adrien> - : int = 1000
<wmeyer> maybe there is a special handling, not present in Tag_val macro
<wmeyer> of course it can't segfault
<wmeyer> because OCaml meant to be typesafe
<adrien> There's Obj.int_tag too
sebz has quit [Quit: Computer has gone to sleep.]
<adrien> hmmm, right
<wmeyer> yes, there is, Tag_val macro is fairy lowlever thing
<wmeyer> so you should not call Tag_val on ints
<adrien> caml_obj_tag in byterun/obj.c first does tests
<wmeyer> cool
<wmeyer> int is not an address
<wmeyer> so first thing what Tag_val does is to dereference the address
<wmeyer> and since your address is 42
<wmeyer> it will nicely segfault
<wmeyer> and all because, these macros assume that you know what you do, and you know the types of your values, so no runtime checking is done to stay efficient.
<wmeyer> cp -r godi/3.12 godi/3.12-ocamlspot
<wmeyer> still need to think how to copy all those sp[io]t files into the godi
<wmeyer> it seems like it's going to just work
<adrien> well, still have issues in my code but it works when I use Int32_val, caml_copy_int32 and Int32.t, so...
<adrien> thanks and good night
ecc has quit [Quit: Leaving]
letrec has joined #ocaml
ulfdoz_ has joined #ocaml
sebz has joined #ocaml
ulfdoz has quit [Ping timeout: 268 seconds]
ulfdoz_ is now known as ulfdoz