adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
peterbb has quit [Quit: peterbb]
mfp has quit [Ping timeout: 260 seconds]
dckc has quit [Ping timeout: 272 seconds]
ollehar has quit [Ping timeout: 264 seconds]
dckc has joined #ocaml
ollehar has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
malc_ has joined #ocaml
theblatte has quit [Ping timeout: 258 seconds]
theblatte has joined #ocaml
sagax has joined #ocaml
<sagax> hi all!
snowpanda has joined #ocaml
<sagax> why this simple example was failed? http://dev.realworldocaml.org/variables-and-functions.html#why-dont-variables-vary >> Pattern Matching and let
<sagax> let (ints,strings) = List.unzip [(1,"one"); (2,"two"); (3,"three")];;
<sagax> i got >> Error: Unbound value List.unzip
<sagax> i run it in `ocaml` repl
<sagax> ocaml-core was installed
malc_ has quit [Ping timeout: 246 seconds]
malc_ has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
zv has quit [Ping timeout: 244 seconds]
dborisog__ has joined #ocaml
mbuf has joined #ocaml
malc_ has quit [Ping timeout: 240 seconds]
malc_ has joined #ocaml
kleisli_ has quit [Ping timeout: 260 seconds]
chripell has joined #ocaml
Serpent7776 has joined #ocaml
osa1 has joined #ocaml
ggole has joined #ocaml
osa1 has quit [Remote host closed the connection]
osa1 has joined #ocaml
<Fardale> sagax: List.unzip is not part of the standard library, so to use it in the repl, you need to load the library and then open it
<Fardale> I use topfind to load library in utop, I don't know how to do it by hand on ocaml repl
sarna has joined #ocaml
vicfred has quit [Quit: Leaving]
snowpanda has quit [Quit: Leaving...]
FreeBirdLjj has joined #ocaml
jbrown has joined #ocaml
Haudegen has joined #ocaml
osa1 has quit [Quit: osa1]
sadiq has joined #ocaml
mfp has joined #ocaml
Anarchos has joined #ocaml
<Leonidas> sagax: `open Core`
<Leonidas> sagax: all the RWO examples assume you have Core open
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
Geekingfrog has quit [Ping timeout: 256 seconds]
Geekingfrog has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ocaml
sarna has quit [Quit: Connection closed]
sarna has joined #ocaml
<flux> very nice, but it really only parses doesn't ie. produce a nice syntax tree: https://github.com/jhjourdan/C11parser
<flux> is there as-simple-as-possible ;) c parsing lib one would want to use for parsing C?
malc_ has quit [Read error: Connection reset by peer]
<flux> actually maybe it's usable for my toy test case, converting cases to graphviz. no extra crap, I can just take the parser.mly and lexer and stick whatever I need to 'case' and chain it back to whichever level I need.
<flux> ..except getting the actual expression values seems quite painful given the tokens are literal string constants. no place to express anything else.
olle has joined #ocaml
kleisli_ has joined #ocaml
waleee-cl has joined #ocaml
<def> flux: I implemented a parser on top of C11parser
<def> I can share the code if you want. But it does not do preprocessing.
<flux> def: yes please!
<def> look at directory parser_with_ast in my fork https://github.com/let-def/C11parser
sarna has quit [Quit: Connection closed]
<flux> def: quite an effort I take it?
<flux> even with dune and everything 🤗
<def> not sure what you want to do. But as long as you keep the license and copyright (BSD I think, most of it copyright INRIA, some me)
<def> you can reuse without worrying :)
<def> ah, this is just C not C++
<flux> good point there
<flux> but I can maybe hack that away as that's not essential
<flux> in fact a simpler test-based approach could serve well also :)
<flux> for serious use there's always clang..
<flux> in fact if I just hack support for xxx.yyy as function calls then I don't even need to modify them away 🤔. I also need the comments for naming nodes.
<def> xxx.yyy() is a function call in a record, it should be fine.
<flux> right :)
<flux> in that case the code probably works as-is
<flux> and I can just hack the comments with search-replace ie. by replacing them with standalone string constants (in this particular piece of code) followed by ;
<flux> I assume writing a merlin-based parser for c++ to be impossible
<flux> and perhaps thrice the size..
<flux> (if it were possible)
<flux> I don't think merlin and lexer can really exchange information in a bidirectional manner?
objmagic has joined #ocaml
muskan has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
h14u has joined #ocaml
dborisog__ has quit [Ping timeout: 264 seconds]
olle has quit [Ping timeout: 244 seconds]
h14u has quit [Ping timeout: 240 seconds]
muskan has quit [Remote host closed the connection]
waleee-cl has quit [Quit: Connection closed for inactivity]
malc_ has joined #ocaml
<flux> def: do you have hints how to get useful error messages out of that?-)
h14u has joined #ocaml
zv has joined #ocaml
Haudegen has joined #ocaml
<mbuf> Is there a way to specify the master branch as .tar.gz in the src section of an opam file?
<hannes> mbuf: sth like src: "git+https://github.com/hannesm/bheap.git#expose-size" ?
<mbuf> hannes, thanks!
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hannes> mbuf: though this will (a) not use a tarball and (b) use a specific branch (you can leave the "#bla" out to get the default branch - you can as well put a commid ID there)
<mbuf> hannes, I see
<ollehar> gnu
<ollehar> oops
<ollehar> sorry
mfp has quit [Ping timeout: 246 seconds]
jnavila has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
objmagic has joined #ocaml
chripell has quit [Ping timeout: 256 seconds]
catern has quit [Excess Flood]
catern has joined #ocaml
malc_ has left #ocaml ["ERC (IRC client for Emacs 28.0.50)"]
malc_ has joined #ocaml
malc_ has quit [Remote host closed the connection]
malc_ has joined #ocaml
kleisli__ has joined #ocaml
kleisli_ has quit [Ping timeout: 260 seconds]
jnavila has quit [Ping timeout: 272 seconds]
mbuf has quit [Quit: Leaving]
<flux> I suppose OCamlGraph doesn't have an easy way to associate data to a vertex or edge that isn't really part of its identity? ie. if I wanted to have integer nodes and arbitrary labels for them, and then build edges by using just the integers.
<Drup> That's more or less what the "Abstract" functors do, but they don't expose the integer nodes
<Drup> you just get an abstract type.
<flux> they don't expose the integer per se, but then I have function like: `val find_edge : t -> vertex -> vertex -> edge` where I must provide a complete vertex to call that. so if the label is part of the identity, then I must give that
<flux> so there's no way to go from that partial information (integer) to the complete information (integer and assigned label)?
<flux> I guess I can then just keep that label information completely separately, but then to use the GraphViz functionality I guess I need to also use first class modules to pass that additional context, in addition to graph
<Drup> humm, that might not be exposed
<Drup> What's your use case exactly ? In most cases, you could just have the complete information, and a custom equality function that only uses the integer
<flux> well my input data is integers. I insert edges using those integers and sometimes I have additional data I can use to create a label for that vertex.
<flux> but other times I don't have access to that additional data
<flux> can I just use ie. label=None in that case if my comparison doesn't care about it?
<flux> doesn't seem quite elegant but if it works.. ?
<Drup> yeah
<flux> and as long I have those edges added before-hand, they stick to the version that has the label st
<flux> | (['L' 'u' 'U']|"") "'" { char_literal lexbuf; CONSTANT (Cst_char "FIXME") }
<flux> | (['L' 'u' 'U']|""|"u8") "\"" { string_literal lexbuf; STRING_LITERAL (Str_literal "FIXME") }
<flux> def, does this mean some work is left to me as well :(
<flux> Drup: it really seems like the later edge additions do overwrite the label as well
<flux> so I need to always find the vertices before adding the edge
<flux> in fact, there's no way to go from "partial vertex" to "complete vertex"
<flux> I guess I way is to keep the labels outside the graph and stuck them in after it's done..
waleee-cl has joined #ocaml
vicfred has joined #ocaml
<Drup> that seems reasonable, yeah
<flux> reasonably easy task to do with .map_vertex
<flux> buut I think this toy is finished, analyzing the state of vvvvvv would probably take a lot more code than this :)
<Armael> :D
<Armael> why are you analyzing the code of vvvvvv?
<flux> the 3700-line case switch seemed fun
<flux> and I was trying to think of ways to make sense of it
<flux> in principle state machines are easy to visualize
<sagax> thanks!
<Armael> yeah
<Armael> I do agree that drawing the graph with the possible transitions sounds interesting
Hrundi_V_Bakshi has quit [Quit: No Ping reply in 180 seconds.]
Hrundi_V_Bakshi has joined #ocaml
<flux> there seem to be many states that are never entered, so I'm wondering if there's maybe other ways that affect that state
<flux> I mean, like most
<flux> ah yes, of course the game.state is indeed a _public_ variable, and ie. Script.cpp has lines like "game.state = 4010;"
<flux> so this analysis is probably not going to work with a hacked c parser, needs c++
<Armael> ah :)
<flux> not to mention Scripts.cpp that has strings that are interpreted that can do state switches with "gamestate(11)"
<flux> I guess someone got bored writing c++ :), but I don't quite see how the super-simple-syntax scripts embedded in c++ are better..
<flux> perhaps running those scripts step-by-step was easy to arrange, assuming no lambda functions used etc
vicfred has quit [Quit: Leaving]
ggole has quit [Quit: Leaving]
catern has quit [Excess Flood]
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
catern has joined #ocaml
malc_ has quit [Ping timeout: 240 seconds]
zv has quit [Ping timeout: 244 seconds]
tmhoang has quit [Quit: Ping timeout (120 seconds)]
tmhoang has joined #ocaml
zv has joined #ocaml
objmagic has joined #ocaml
objmagic has quit [Client Quit]