gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
Cyanure has quit [Remote host closed the connection]
lamawithonel_ has quit [Ping timeout: 255 seconds]
<thelema> hcarty: nice. I've heard of HPF4, and imagine this may make ocaml a bit more convenient for High performance computing
wtetzner has quit [Read error: Connection reset by peer]
orbitz has quit [Ping timeout: 258 seconds]
orbitz has joined #ocaml
mjonsson has joined #ocaml
<hcarty> thelema: I think that's something different - HDF4 = Hierarchical Data Format v4
<hcarty> thelema: It's used frequently for satellite data, among other things. Not likely to be broadly used... but I put a lot of time into the bindings as I learned OCaml, so I'd rather they are available for use rather than rotting away somewhere
<hcarty> Not likely to be broadly used in the OCaml community that is
ViciousPlant has joined #ocaml
Modius has joined #ocaml
ViciousPlant has quit [Ping timeout: 255 seconds]
ViciousPlant has joined #ocaml
iratsu has joined #ocaml
ftrvxmtrx has joined #ocaml
mal`` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mal`` has joined #ocaml
<thelema> hcarty: yes, hdf4 is what I was talking about - used by scientists and not many others
<thelema> the HPC group where I'm at is mostly physicists, not computer scientists
mjonsson has quit [Remote host closed the connection]
ViciousPlant has quit [Ping timeout: 240 seconds]
ViciousPlant has joined #ocaml
sepp2k has quit [Quit: Leaving.]
dgfitch has quit [Ping timeout: 240 seconds]
dgfitch has joined #ocaml
ViciousPlant has quit [Ping timeout: 276 seconds]
ulfdoz has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
ymasory has quit [Quit: Leaving]
likebike has joined #ocaml
<likebike> Hi guys. I am trying to use this syntax: let h :: t = myList in ... and it works, but I always get the compilation warning about not matching []. Is there any way to adjust that syntax to make the compiler happy, or turn off the warning somehow?
<likebike> I know that the [] case will never happen because I check for that elsewhere.
<likebike> (I'm using a while loop instead of a recursive loop function.)
<adrien> likebike: use List.hd/List.tl instead?
<likebike> ya, i could do that. It's just that the "let h :: t = mylist" syntax is nicer, and I assume that is is probably faster too (i have not tested this theory).
<adrien> List.hd is probably nothing more than "let hd = function | h :: t -> h | [] -> raise Invalid_argument"
<adrien> maybe inlined
<adrien> you can also write that directly
<adrien> when you get a warning about non-exhaustive pattern matches, ocaml actually generates code that is going to be slower but _it_ puts the check for the cases you haven't put and raises an exception in that case
<likebike> i see
<adrien> you could also do it so that you get the head of the list in the same place of code that you check for the length
<likebike> This loop is running a BILLION times, so I'm trying to optimize things. That's why I'm switching from recursive loop function to 'while' loops, and stuff like that. I am assumed that the "let h :: t = mylist" syntax would be faster than two separate calls (one to List.hd and one to List.tl).
<likebike> I'll have to test.
<likebike> thanks for your help adrien
<adrien> recursion will be optimized out to a while loop if you make the function tail-recursive
<adrien> if you're using a while loop, also, maybe that an array will match your code structure better
<likebike> I hope so! I will switch out the recursive loops with the while loops and run some benchmarks. If there is no performance difference, I'll stick with the recursive forms.
edwin has joined #ocaml
ankit9 has joined #ocaml
wormphlegm has quit [Quit: leaving]
larhat has joined #ocaml
StepanKuzmin has joined #ocaml
Modius has quit [Quit: "Object-oriented design" is an oxymoron]
__mattam__ is now known as mattam
orbitz has quit [Ping timeout: 276 seconds]
orbitz has joined #ocaml
thomasga has joined #ocaml
dnolen_ has quit [Quit: dnolen_]
Cyanure has joined #ocaml
StepanKuzmin has quit [Read error: Connection reset by peer]
StepanKuzmin has joined #ocaml
ankit9 has quit [Quit: Leaving]
bobry has joined #ocaml
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
ankit9 has joined #ocaml
StepanKuzmin has quit [Read error: Connection reset by peer]
StepanKuzmin has joined #ocaml
Amorphous has quit [Ping timeout: 260 seconds]
clog has joined #ocaml
<hcarty> thelema: Oh, that's cool. I'm sorry I didn't do a proper release sooner then :-) Let me know if you have a use for the library and if you have any questions/suggestions.
<thelema> no problem
_andre has quit [Ping timeout: 260 seconds]
_andre has joined #ocaml
thomasga has joined #ocaml
bobry has quit [Quit: Leaving.]
bobry has joined #ocaml
redrumx has joined #ocaml
redrumx has quit [Client Quit]
wishi has quit [Quit: No Ping reply in 180 seconds.]
wishi has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
StepanKuzmin has quit [Remote host closed the connection]
Cyanure has quit [Remote host closed the connection]
lopex has joined #ocaml
barismetin has joined #ocaml
<hcarty> gildor: I think it may be useful to have a description or origin field for external programs and external libraries on the oasis-db/odb admin panel
<hcarty> gildor: Something as simple as "This is provided with the core OCaml distribution" or "This is provided by omake"
hyperboreean has quit [Ping timeout: 252 seconds]
<thelema> hcarty: good idea - I don't think I even know what h4cc is
<hcarty> thelema: That's what I was thinking when I added it :-) h4cc is a wrapper script around the gcc or whichever compiler is used to build the HDF4 library.
<hcarty> s/the gcc/gcc/
<thelema> ah. That would be a harder one to figure out. I guess google would help, though
<hcarty> Or perhaps s/the//...
hyperboreean has joined #ocaml
sepp2k has joined #ocaml
* thelema is trying to make something happen after a printf with user-specified format string
alpounet has quit [Ping timeout: 246 seconds]
Pepe_ has quit [Ping timeout: 260 seconds]
lopex has quit []
<gildor> hcarty: good idea, fill a bug report
<gildor> hcarty: I think you could state that it should be coupled with the ability to define "virtual package"
<gildor> hcarty: i.e. package that won't be available/listed on oasis-db but used to gives hint to people
<gildor> hcarty: e.g. pkg-config libraries, where we will be able to attach various data, like a homepage and a Debian package
<gildor> (though it will remain 2nd class citizen, i.e. not exported, just here for information)
<hcarty> gildor: That sounds like a good idea. Sort of a light-weight version of the conf-* packages in GODI.
louis418 has joined #ocaml
<hcarty> gildor: Should oasis and oasis-db bugs/requests go to the same tracker? Or do you have separate tools for each project?
ankit9 has quit [Quit: Leaving]
larhat has quit [Quit: Leaving.]
<gildor> hcarty: that is the same BTS
<hcarty> gildor: Submitted. #1010
<chambart> gildor: I am using pgocaml in a project compiled with oasis, I was wondering how to add a configure option for PGUSER, PGDATABASE, etc...
joewilliams_away is now known as joewilliams
StepanKuzmin has joined #ocaml
louis418 has quit [Quit: 暫離]
<gildor> hcarty: thx
<hcarty> thelema: I'm not sure I completely follow what you are doing - but would something like "ksprintf ignore ..." work?
<gildor> chambart: I use to export them through a Makefile
<hcarty> thelema: Or ksprintf (tap exit |- ignore) ...
<gildor> chambart: there is no portable way (without Unix) to putenv in fact
* gildor gtg
avsm has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
<thelema> yes, I figured that out right after posting
<thelema> hcarty: ^^
<hcarty> thelema: Cool. I ran into a similar issue using ( ^^ ) in a logging function.
alexyk has joined #ocaml
<thelema> have you had a chance to look at batlog?
<hcarty> thelema: Not yet, but it's on my list
<thelema> no problem, just looking for feedback from other people who've written logging libraries
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
othiym23 has joined #ocaml
barismetin has quit [Remote host closed the connection]
bobry has quit [Ping timeout: 255 seconds]
_andre has quit [Ping timeout: 250 seconds]
_andre has joined #ocaml
Pepe_ has joined #ocaml
ztfw has joined #ocaml
edwin has quit [Remote host closed the connection]
ankit9 has joined #ocaml
Cyanure has joined #ocaml
barismetin has joined #ocaml
ulfdoz has joined #ocaml
Tianon has quit [Ping timeout: 260 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
ftrvxmtrx has joined #ocaml
barismetin has quit [Remote host closed the connection]
sepp2k has joined #ocaml
lopex has joined #ocaml
ankit9 has quit [Quit: Leaving]
jamii has joined #ocaml
rwmjones is now known as rwmjones_gone
alpounet has joined #ocaml
<dsheets> anybody here have experience with menhir error handling? or ocamlyacc error handling?
<thelema> dsheets: a bit, what's up?
<dsheets> I have a nonterminal that represents the end (or else-continuation) of a conditional.
<thelema> ok
<dsheets> I would like to gracefully handle unterminated conditionals
<dsheets> so I used the "error" token in the position of the cond_continue nonterminal
<dsheets> but menhir doesn't appear to be shifting it?
<dsheets> So I probably don't understand the mechanism but I'm having some trouble finding examples
<thelema> can you have the error token not by itself?
<dsheets> i'm parsing glsl es shader preprocessor expressions
<dsheets> is this the right way to use the 'error' token?
<dsheets> also, yes, this is going open source (as much as the OpenGL ES spec license) as soon as it's remotely useful
<thelema> I think the only way to use the error token is by itself, similar to _ in regular patterns, except more restricted
<dsheets> hrm so you have to devote an entire state to error handling if you care about error context?
<thelema> you could give your cond_continue rule an `| error -> ...` option
<thelema> s/option/alternative/
<dsheets> I did that but then I didn't have access to the first=IF token for the error message
<dsheets> I guess that's ok
<thelema> ah, the way to do this is with global variables - set the info you need aside and access it when you need it
<thelema> at least that's the traditional way.
<dsheets> blerg! i thought i got away from that in the lexer with its magical contexts of pain
<dsheets> ok… i guess i should be more pragmatic
<dsheets> thanks for the clue :-)
barismetin has joined #ocaml
avsm has joined #ocaml
Cyanure has quit [Ping timeout: 250 seconds]
ulfdoz has quit [Ping timeout: 240 seconds]
barismetin has quit [Remote host closed the connection]
oriba has joined #ocaml
barismetin has joined #ocaml
<dsheets> thelema: hmm… so the error token works either if i force it into cond_continue or if i use it at the end of the directive production. I think the problem is that I never shift on error and so error remains the lookahead token until the whole parser fails as it bubbles up
<dsheets> but how do I shift on error?
<thelema> ah, you need to get error off the stack
<dsheets> i guess the reduce on the production doesn't do that as all future lookaheads are "error" after I enter the mode?
<thelema> "When a state that can shift on error is found, the error token is shifted.
<dsheets> right. how do I construct such a state? don't you have to shift error to reduce a production with error in it?
<dsheets> i need to ensure _another_ shift after that?
ftrvxmtrx has quit [Quit: Leaving]
<dsheets> or am i fundamentally misunderstanding the automaton?
<thelema> umm, shift puts things on the stack
<thelema> reduce matches the top of the stack with a pattern
<thelema> isn't it?
<dsheets> yes
<thelema> why do you need to shift more?
<dsheets> to get rid of the error token? i want to recover and resume normal-mode parsing
<thelema> menhir puts ERROR on the top of the stack if there's something available to reduce it
<dsheets> hmm perhaps I have another error in my test cases, then
_andre has quit [Quit: leaving]
<thelema> when you take an action on the next input token, you leave error recovery mode.
<thelema> consuming error is usually part of this
<dsheets> so http://pastebin.com/pJy8hbtf should recover from a missing cond_continue (say after EOF is found) and continue parsing as if an #ENDIF was found and then consume the EOF and complete sucessfully?
<dsheets> doh there are more expected tokens at this state like ENDPPDIRECTIVE so there are additional errors that occur which fail the parse
<thelema> are you calling menhir --error-recovery?
<dsheets> no
<thelema> ok, then ignore the error recovery mode stuff
<thelema> just match error everywhere you need to
<dsheets> ok. i just missed a place which caused the flailing :-P
<dsheets> thanks for the help and sorry for the confusion
barismetin has quit [Remote host closed the connection]
<thelema> n/p
<dsheets> thelema: and it works like a charm
<thelema> yay
<thelema> and now I know that the error token doesn't have to be by itself
RAW is now known as impy
<dsheets> i'm thinking about a series of blog posts regarding this tool
<dsheets> sort of a "how to use menhir+ulex to consume c-like languages for tools on the command-line and in the browser"
<thelema> dsheets: That sounds useful
<dsheets> and of course with pointers to the open code on github etc
<thelema> of course - makes it even better
ikaros has joined #ocaml
barismetin has joined #ocaml
Plazma-Rooolz has joined #ocaml
Cyanure has joined #ocaml
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Client Quit]
barismetin has quit [Remote host closed the connection]
<_habnabit> is there an example of how enums work in batteries? I mean, how do I use this module?
<_habnabit> it looks like, say, BatList, will give you an enum.
<_habnabit> but if I was implementing my own sequence type, would I include the enum module in my own module, or just write converters to/from enums?
barismetin has joined #ocaml
__mattam__ is now known as mattam
ftrvxmtrx has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
barismetin has quit [Remote host closed the connection]
oriba has quit [Quit: oriba]
olasd has quit [Ping timeout: 264 seconds]
Transformer has joined #ocaml
Transformer has left #ocaml []
olasd has joined #ocaml
olasd has quit [Ping timeout: 264 seconds]
olasd has joined #ocaml
Cyanure has quit [Remote host closed the connection]
olasd has quit [Ping timeout: 264 seconds]
ztfw has quit [Remote host closed the connection]
olasd has joined #ocaml
olasd has quit [Ping timeout: 276 seconds]
olasd has joined #ocaml
hcarty__ has joined #ocaml
<hcarty__> _habnabit: Your best reference is probably the other modules in Batteries
<hcarty__> _habnabit: You would probably use something like Enum.I it
<hcarty__> Or something elsefrom the Constructors section of the Enum documentation.
<hcarty__> gildor: Can you update the #ocaml topic to point to the 3.12.1 release?
olasd has quit [Ping timeout: 264 seconds]
olasd has joined #ocaml
hcarty__ has quit [Quit: Bye]
lamawithonel has joined #ocaml
olasd has quit [Ping timeout: 240 seconds]
olasd has joined #ocaml