<apache2>
at least I read that somewhere (not too keen on what the difference is)
larhat has joined #ocaml
<dkreuter>
oh, I can have virtual methods and inherit from that interface
larhat has quit [Client Quit]
larhat has joined #ocaml
<dmbaturin>
Yes, you can use objects without classes (I've seen people defining object types without ever defining a class).
<dmbaturin>
dkreuter: Even though it's possible to write ocaml like it's python, it's not what most people do. :)
larhat has quit [Client Quit]
<dkreuter>
dmbaturin, this is my first day, I'll get more idiomatic later
larhat has joined #ocaml
<apache2>
there are mixed opinions about the "Core" library, but I think that the book "Real World OCaml" explains Lwt fairly well, you could check that out
larhat has quit [Client Quit]
<dkreuter>
In this syntax: type 'a iterator = < get : 'a; has_value : bool; next : unit > ;;
larhat has joined #ocaml
<dkreuter>
how can I specify argument types
<dkreuter>
(instead of return types)
<apache2>
usually those are the same, use -> to separate the types. the last item in the list is the return value
<nullcat>
and I functorize it to target different backend in order to use it in Mirage
<rgrinberg>
yeah, you're also exposing all of your records now
<rgrinberg>
i assume it's because you're in dev mode
<nullcat>
all records?
ygrek has quit [Ping timeout: 250 seconds]
<nullcat>
like user_ids, etc?
<rgrinberg>
yeah
<rgrinberg>
although i haven't had a close look, maybe it's ok
<rgrinberg>
it's usually something i end up regretting :/
<nullcat>
well, for example, i sent an api call to get your follower list, i get back a user_ids record, I can then examine your their ids
<nullcat>
examine their ids
<rgrinberg>
yeah but you could also leave the type abstract and just expose some projections. etc. val ids : user_ids : int list;
<rgrinberg>
anyway it's a matter of taste/style
<rgrinberg>
also, have you considered dropping core? As sad as it is, i'm sure your lib would get a much warmer reception if it did that
<Drup>
rgrinberg: considering it maps the twitter API, there are less chances that it's going to change
<nullcat>
lol i am really considering to do that
<Drup>
making the type abstract allow you to change the implementation, but in this case, there are less reasons to do that
<nullcat>
it leads to some problem, conflict with ppx_deriving_yojson. I talked to Drup about this days ago
<rgrinberg>
ok then I guess it's fine
<Drup>
nullcat: once you have finished, I will be able to add twitter to the list of ocamlgraph overlay that I do for fun
<Drup>
(I wanted to do on the previous one, but the API was too anoying)
<Drup>
(previous twitter library)
<nullcat>
yes it feels good someone is expecting it. I can get more advices and feedback, which are really important for beginner
<nullcat>
btw, i didn't see you on twitter
<Drup>
expecting is a big word
<rgrinberg>
Drup: finished the library or finished removing core? :P
<nullcat>
well, i mean "want to use it"
<nullcat>
"be useful to some people"
<Drup>
nullcat: well, probably because I'm not on it
<nullcat>
good..
<Drup>
I don't use twitter
<nullcat>
ok, that's fine
<Drup>
I just like to do ocamlgraph overlays because it's fun
<Drup>
:]
nojb has joined #ocaml
<rgrinberg>
tweets are too long for ideal communication IMO
<rgrinberg>
80 chars is golden
mengu has joined #ocaml
<nullcat>
..
<Drup>
I have no opinion, I'm just not interested by this medium of communication
<nullcat>
i understand. I don't really mind anyone using it or not.
<Drup>
(oh, and I hate "free" not so free services)
<rgrinberg>
Drup: yeah you seem to be more of a snapchat guy to me :P
<Drup>
ahah
<Drup>
so not happening
manizzle has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nojb>
in the Mach language (in the compiler), the Iconst_int parameter is a nativeint but this doesn't seem right when cross-compiling, it should be int32 or int64 depending on the word size of the target machine ...
<rgrinberg>
the PathPiece a stuff is basically your converters
<Drup>
more like the Atom
<Drup>
but yeah, they do have pretty much the same design, with a set of atom (PathPieces) and converters (with some weird typeable magic that I don't really understand)
<rgrinberg>
oh yeah, so i guess he doesn't need converters at all pathpiece instances cover that
<Drup>
probably, yes
<rgrinberg>
isn't typeable just deriving implemented in the compiler?
<rgrinberg>
what's wrong with that?
<Drup>
it doesn't cover the whole language
nojb has quit [Quit: nojb]
<Drup>
huum, type level lists
<rgrinberg>
hmm, i guess i don't know enough... what do you mean?
<rgrinberg>
there's a typeable instance for every type in haskell no?
<rgrinberg>
"* Typeable is now generated by default for all data types automatically."
<Drup>
hum, ok, that's rather recent
<rgrinberg>
you're not checking often enough :P
<Drup>
No, I don't :)
<rgrinberg>
still you've accomplished what spock does without all the fancy stuff
<Drup>
they don't have queries, I wonder why
<rgrinberg>
when your only tool is OCaml, every problem looks like a GADT :P
Denommus has quit [Remote host closed the connection]
<Drup>
well, the only stuff that would make my life easier is type level lists
<Drup>
the rest is not very useful
b0mbastus has joined #ocaml
<rgrinberg>
I was actually surprised that your lib supported query params and you wanted to extend it. Most people consider "routing" in the RESTful sense. E.g. a path identifying a resource
nullcat_ has joined #ocaml
<Drup>
peh, too easy.
<Drup>
The reason is simple: that's how we do it in eliom =')
<Drup>
worse, we can convert between query, post and path (by ordering them/like/that
<Drup>
rgrinberg: apparently, spock doesn't have list in urls
<Drup>
that's very disapointing
<rgrinberg>
eliom basically considers http to be an rpc layer, right?
<rgrinberg>
what do you mean it doesn't have lists?
<Drup>
well, list
<Drup>
path/thingy/1/4/5/32/
<Drup>
int list.
* Drup
imagines the look of horror on rgrinberg's face.
<rgrinberg>
ah, variable length paths
<Drup>
with the same type, yes :]
<struktured>
curse you solaris...it's like linux except none of your shell scripts work when you write them in linux
<rgrinberg>
yeah they're basically an anti pattern
<rgrinberg>
but they could be useful for mounting a webapp under a url
<rgrinberg>
well not lists
<Drup>
well, you can do them in furl :D
<rgrinberg>
but something that matches the rest
<Drup>
(empty, or not empty, you have the choice)
<Drup>
oh yeah, "matching the rest" is easy
<Drup>
it's a string list.
<rgrinberg>
struktured: isn't there some sort of gnu tools package?
<rgrinberg>
can't be worse than a mac
<rgrinberg>
so Drup does eliom even need http?
<struktured>
rgrinberg: example: tar in solaris does not have decompression options
<rgrinberg>
couldn't you reimplement the whole protocol on top of websockets for example
<Drup>
rgrinberg: well, sure, how do you access the webpage otherwise ? :D
<struktured>
it is worse than a mac, actually. mac uses latest gnu stuff
<Drup>
and really, eliom doesn't use http for continuous communication. There is no reason to use websocket for that ...
<Drup>
(that=occasional request)
ggole has joined #ocaml
<Drup>
(and yes, the rpc bits is done through http)
<rgrinberg>
i thought of it because there's an interesting framework in erlang that basically does everything on top of websockets
<rgrinberg>
e.g. updating a dom element is pushing a little js script to the page to be evaluated
<rgrinberg>
Drup: but anyway i think it does matter. It makes the implementation way simpler
<Drup>
does it ?
<rgrinberg>
no need to hack your protocol into http and deal with artifacts
<nullcat_>
is it commonly used... ?
<nullcat_>
this library?
<nullcat_>
i trust Bunzli but...
<nullcat_>
buenzli
<rgrinberg>
nullcat_: listen to Drup i don't know...
<rgrinberg>
i'd just just a polymorphic variant and forget about it
<nullcat_>
make sense...
<Drup>
rgrinberg: you need to hack it into http anyway if you want the user to be able to access any page indivdually
<Drup>
except if you give on non-js user
<Drup>
but eliom doesn't
<Drup>
and really, we don't hack anything into http, there is not much to map
<rgrinberg>
can eliom naturally stream binary data to a client?
<rgrinberg>
e.g. video
Denommus has joined #ocaml
<Drup>
(ok, a bit of clever marshaling to preserver sharing across client/server boundaries ..)
<Drup>
yeah
<Drup>
there is a special thing for that
<rgrinberg>
in n2o it's just like anything else
<Drup>
never used it, but I know it exists
<Drup>
well, sure, everything is binary data
<Drup>
and screw non-js users :/
<Drup>
(also, screw people behind firewalls)
<rgrinberg>
ah yes, let's see these non-js friendly eliom apps :P
<rgrinberg>
Drup: encryption solves the firewall issues
<Drup>
what about them ?
<rgrinberg>
i'm just saying, if you're just serving static data or you just have simple forms
<rgrinberg>
you can get by with anything
<Drup>
I mean, ocsigen.org is doing exactly what you describe (with AJAX calls instead of websockets)
<Drup>
and it still works fine if you don't have js enabled
<rgrinberg>
because it's static data, n2o also loads whatever html you want initially
<rgrinberg>
but anyway i know eliom can do all this stuff
<rgrinberg>
i'm just saying it's the implementation complexity
<rgrinberg>
doing everything 1 simple way pays off
<Drup>
and I argue that you loose some stuff with your supposed simplicity
<rgrinberg>
e.g. no long polling, ajax calls, etc.
<rgrinberg>
http encodings
<Drup>
ajax calls are not more complicated than websocket ones ...
<Drup>
The real difficult part is updating the environment correctly
<Drup>
and the mean of transmission doesn't change a single thing for that
<Drup>
for erlang it's a bit easier because of the untypedness
<Drup>
they can hotswap at will and it works
<Drup>
not in OCaml
<Drup>
that's were the complexity is
<Drup>
not in the AJAX calls
<Drup>
and recovering sharing for DOM nodes after transmission, that's difficult too
nojb has quit [Quit: nojb]
<rgrinberg>
anyway i'm not saying that this is the most difficult part in implementing a web framework
<Drup>
well, you did started by "it's simpler" :D
<nullcat_>
jane street wants their Result.t to be merged in ocaml trunk...
<rgrinberg>
it's just that when you make a client-server protocol you rarely WANT a transport like http. you're just forced to use it
<nullcat_>
what do you guys think?
<Drup>
nullcat_: I wrote what I though about it on the PR already :D
<Drup>
rgrinberg: I just thing than, in the whole web stack, http is far less an issue than the rest X_x
<Drup>
think
<Drup>
rgrinberg: but heh, soon enough, we will cut eliom in little pieces and you will be able to implement everything over websocket and be happy :D
JuggleTux has joined #ocaml
hilquias has joined #ocaml
<rgrinberg>
Drup: one day you'll review my pr's :P
<Drup>
start by PRing furl :3
<rgrinberg>
we need websocket support on the server side first
<rgrinberg>
struktured: is this why you're thinking of writing some ocamlscript btw?
<rgrinberg>
for portability
<Drup>
rgrinberg: don't we already have that ?
<rgrinberg>
Drup: websocket support?
<Drup>
yeah
<rgrinberg>
just vbmithr's code right?
<rgrinberg>
but that needs cohttp
<Drup>
well, yeah, is that an issue ?
<rgrinberg>
yeah... ocsigen has to support cohttp first
<Drup>
ah, yeah, sure
<Drup>
=')
<nullcat_>
oh god, It's such a pain to remove core_kernel.std
<Drup>
rgrinberg: we start back on that monday
<nullcat_>
fixing error everywhere <(=σ′д`)σ
<Drup>
nullcat_: replace with containrs :D
<Drup>
containers*
<rgrinberg>
do not -_-. the point of this isn't to favor one stdlib over another
<rgrinberg>
it's to be agnostic
<Drup>
being agnostic is 1) not exposing the stdlib in your API 2) not inheriting defaults
<Drup>
you can use and stdlib just fine, as long as you don't expose it and that it doesn't prevent you to do anything ...
<Drup>
the issue is that core_kernel is not (yet) completely portable (and still quite huge)
<nullcat_>
core_kernel is still not portable <- yeah i am worried about this problem this afternoon. I almost asked on the mailing list because I don't really trust what this post says https://blogs.janestreet.com/a-lighter-core/
<nullcat_>
they say async_kernel is now unix-independent
<struktured>
rgrinberg: ocaml script? it's just an easy way to get ocaml into one of the projects. I want to compile native and run a separate server which interacts through middleware in the future though
<rgrinberg>
that's async...
<rgrinberg>
core_kernel works on mirage
<rgrinberg>
it's big on js but for your project it doesn't matter
<struktured>
ok solaris, you win for tonight. I fix about 5 problems that prevent it from bootstrapping with the opam source. wonder how many more are left
<nullcat_>
rgrinberg: i see your point, but why you say if i get rid of core_kernel, my library would be more desirable
<rgrinberg>
just people are like that
<nullcat_>
...ok (థ౪థ)
nojb has joined #ocaml
nojb has quit [Client Quit]
NSA_Agent has quit [Ping timeout: 276 seconds]
<nullcat_>
no String.slice if i don't use core...
hilquias has quit [Ping timeout: 272 seconds]
nullcat_ has quit [Ping timeout: 272 seconds]
hay207 has joined #ocaml
MercurialAlchemi has joined #ocaml
mort___ has joined #ocaml
swgillespie has joined #ocaml
nullcat has joined #ocaml
ygrek has joined #ocaml
hay207 has quit [Quit: Leaving]
mort___ has quit [Quit: Leaving.]
<nullcat>
well, that's a pretty stupid complain. there is string.sub in stdlib...
ygrek_ has joined #ocaml
ygrek has quit [Remote host closed the connection]
<flux>
dkreuter, Lwt isn't magic and could be (and I assume is except for some select loop support) implemented in pure OCaml
<flux>
dkreuter, I think the way to learn about it: 1) learn continuation passing style 2) make an IO-framework using CPS 3) add multiple-worker-support to it 4) hide the CPS under a monad 5) LWT!
<flux>
tmtwd, there is a library called 'ancient' that allows moving stuff out from the garbage-colleted OCaml heap. apparently it's useful if you have huuuge traversable data structures that you want to keep OCaml's hands off of.
<flux>
nullcat, I guess it would be nice if some Result.t was in the standard library. this way the Result.t's of all libraries would eventually become compatible.
<flux>
phew, lastlog reading completed :-)
<nullcat>
thx!
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
A1977494 has joined #ocaml
A1977494 has quit [Client Quit]
BitPuffin|osx has quit [Ping timeout: 256 seconds]
<adrien>
who was talking about lazyness and speed? :)
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
oscar_toro has joined #ocaml
larhat has quit [Client Quit]
<reynir>
wow, the comments
larhat has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hay207 has joined #ocaml
larhat has quit [Client Quit]
<adrien>
argh
larhat has joined #ocaml
larhat was banned on #ocaml by adrien [larhat!*@*]
larhat was kicked from #ocaml by adrien [fix your connection, pm when it's done]
<adrien>
so
<adrien>
comments? never read the comments! :P
nullcat has joined #ocaml
<reynir>
heh I guess
hay207 has quit [Client Quit]
<adrien>
you need to go on youtube and read the comments there
<adrien>
that should ensure you don't make the same mistake again
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
logzet has quit [Ping timeout: 272 seconds]
nojb has joined #ocaml
rossberg has quit [Ping timeout: 265 seconds]
ygrek_ has quit [Ping timeout: 255 seconds]
Kakadu has joined #ocaml
mort___ has joined #ocaml
dav has joined #ocaml
rossberg has joined #ocaml
dav has quit [Read error: No route to host]
asQuirreL has joined #ocaml
shinnya has joined #ocaml
matason has joined #ocaml
mort___ has quit [Quit: Leaving.]
ollehar has joined #ocaml
nojb- has joined #ocaml
ingsoc has joined #ocaml
jyc_ has joined #ocaml
bernardo1pc has joined #ocaml
jyc has quit [Ping timeout: 256 seconds]
bernardofpc has quit [Ping timeout: 256 seconds]
Unhammer has quit [Ping timeout: 256 seconds]
Unhammer has joined #ocaml
ollehar has quit [Ping timeout: 272 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
psy_ has quit [Ping timeout: 272 seconds]
sgnb` has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
oscar_toro has quit [Quit: Lost terminal]
rossberg_ has joined #ocaml
dmbaturin_ has joined #ocaml
Gama11_ has joined #ocaml
an has joined #ocaml
troydm has joined #ocaml
rossberg has quit [*.net *.split]
Gama11 has quit [*.net *.split]
Guest78106 has quit [*.net *.split]
dmbaturin has quit [*.net *.split]
sgnb has quit [*.net *.split]
adrien_znc has quit [*.net *.split]
struk|desk has quit [*.net *.split]
inr has quit [*.net *.split]
cschneid has quit [*.net *.split]
sheijk has quit [*.net *.split]
darnuria has quit [*.net *.split]
SIGILL has quit [*.net *.split]
welterde has quit [*.net *.split]
Remyzorg has quit [*.net *.split]
alpen has quit [*.net *.split]
osheeta has quit [*.net *.split]
mattrepl has quit [*.net *.split]
_habnabit has quit [*.net *.split]
habnabit has joined #ocaml
mrknife has joined #ocaml
struk|desk has joined #ocaml
mrknife is now known as Guest26344
sheijk has joined #ocaml
noze has joined #ocaml
osheeta has joined #ocaml
SIGILL has joined #ocaml
jabesed has joined #ocaml
cschneid has joined #ocaml
alpen has joined #ocaml
Remyzorg has joined #ocaml
mattrepl has joined #ocaml
thomasga has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
inr has joined #ocaml
jabesed has quit [Ping timeout: 252 seconds]
darnuria has joined #ocaml
dmbaturin_ is now known as dmbaturin
<noze>
what's a good way to write debug printing?
<noze>
ie when i run my program with --verbose=debug it should print "somemodule.ml:42: doing this and that now in SomeModule.function". how do i do that? is there a tutorial?
<adrien>
Author: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
<adrien>
Date: Thu Apr 10 14:11:25 2014 +0000
<adrien>
Add %loc_* primitives and corresponding values in Pervasives
<adrien>
that really didn't get publicized properly...
Remyzorg has quit [*.net *.split]
mattrepl has quit [*.net *.split]
mattrepl_ is now known as mattrepl
<adrien>
this might have been a camlp4 stuff that then got implemented directly inside Pervasives after camlp4 was split from the main tree
<noze>
what would be a good place to look for an example to use them "The Right Way"?
<nojb>
sorry, no idea - they are there mainly for use by ppx extensions, but I don't think they have been put to use just yet ...
Haudegen has joined #ocaml
Remyzorg has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
thomasga has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
nojb- has quit [Ping timeout: 240 seconds]
matason has quit []
dsheets has quit [*.net *.split]
jabesed has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
Haudegen has joined #ocaml
Hannibal_Smith has joined #ocaml
milosn has quit [Quit: leaving]
<ggole>
noze: an overly simple example would be let dlog loc = ksprintf (fun str -> printf "bad thing %s happened at %s" str loc)
<ggole>
Then call it like dlog __LOC__ "florp %d" 10
<zozozo>
noze: it seems there is a little typo in the documentation of __POS_OF__ : it says it returns a pair (expr,loc), but according to the type it should be a pair (loc,expr)
hilquias has joined #ocaml
sdothum has joined #ocaml
tanguy` has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
tmtwd has quit [Quit: Leaving]
BitPuffin|osx has joined #ocaml
Haudegen has joined #ocaml
tmtwd has joined #ocaml
ontologiae_ has joined #ocaml
Submarine has joined #ocaml
Submarine has joined #ocaml
Cyanure has joined #ocaml
tanguy` has quit [Read error: Connection reset by peer]
tanguy` has joined #ocaml
<flux>
there's a branch that allows functions to get an optional argument 'loc' in, and if you don't fill it, it will automatically get filled in with the call site
<flux>
..but that's not in the mainline yet, AFAIK
<flux>
and of course no guarantees it will be.
<Drup>
I think it was closed and abandonned
<flux>
oh, ok
<flux>
it might've had been useful at times.
<Drup>
well, it could have been used to remove the hack in Lwt_log's syntax extension
osa1_ has joined #ocaml
<flux>
wild guess: exceptions?
<flux>
oh, syntax extension, so no
<Drup>
no no, just inserting the location
<flux>
but it would remove the need to use syntax extensions for that stuff
<flux>
ad-hoc logging could be easier
<flux>
"log this only when it's being called from module X"
Guest26344 is now known as mrknife
mrknife is now known as Guest95232
tmtwd has quit [Quit: Leaving]
Guest95232 has quit [Changing host]
Guest95232 has joined #ocaml
Guest95232 has quit [Changing host]
Guest95232 has joined #ocaml
Haudegen has quit [Ping timeout: 258 seconds]
Denommus has quit [Ping timeout: 256 seconds]
tanguy` has quit [Read error: Connection reset by peer]
tanguy` has joined #ocaml
alexis_ has joined #ocaml
alexis_ has quit [Client Quit]
alexis_ has joined #ocaml
alexis_ has quit [Client Quit]
<dmbaturin>
As a user, I usually find location info in log messages annoying rather than helpful.
<dmbaturin>
As a developer, I usually have some idea where I produce this or that log message already. :)
ollehar has joined #ocaml
<adrien>
it's probably less useful for ocam
<adrien>
l
<adrien>
for C you have so much more duplication, especially in error paths, that you really need them
<dmbaturin>
Well, true.
ollehar has quit [Ping timeout: 272 seconds]
mengu has joined #ocaml
milosn has joined #ocaml
mengu has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
idegen has joined #ocaml
cirklo has quit []
osa1_ has quit [Ping timeout: 265 seconds]
darkf has quit [Quit: Leaving]
Anarchos has joined #ocaml
<yminsky>
Anyone have experience using iocaml? I'm having trouble figuring out how to load other libraries --- #require doesn't seem to work.
tanguy` has quit [Read error: Connection reset by peer]
tanguy` has joined #ocaml
<Drup>
you will have to recompile a new kernel with these library loaded
<yminsky>
"Cannot find file topfind" when I do #use "topfind"
<ggole>
My guess is that the problem is there
<ggole>
(Topfind is what provides the #require machinery.)
<ggole>
I have no particular knowledge of iocaml though.
hay207 has joined #ocaml
osa1_ has joined #ocaml
osa1_ has quit [Read error: Connection reset by peer]
osa1_ has joined #ocaml
ollehar has joined #ocaml
osa1_ has quit [Client Quit]
AlexRussia has quit [Quit: WeeChat 1.2-dev]
nojb has joined #ocaml
palomer has joined #ocaml
hilquias has quit [Remote host closed the connection]
tanguy` has quit [Read error: Connection reset by peer]
tanguy` has joined #ocaml
ollehar has quit [Ping timeout: 250 seconds]
psy_ has joined #ocaml
SIGILL has quit [Read error: Network is unreachable]
SIGILL has joined #ocaml
jeroud has quit [Read error: Connection reset by peer]
lopex has quit [Read error: Connection reset by peer]
flxx has joined #ocaml
mehdi_ has quit [Quit: No Ping reply in 180 seconds.]
alpen has quit [Ping timeout: 265 seconds]
mehdi_ has joined #ocaml
cschneid has quit [Ping timeout: 265 seconds]
mal`` has quit [Ping timeout: 265 seconds]
mawuli has quit [Ping timeout: 265 seconds]
struk|desk2 has joined #ocaml
flx has quit [Remote host closed the connection]
sgnb`` has joined #ocaml
struktured has quit [Remote host closed the connection]
struk|desk has quit [Remote host closed the connection]
lupine has quit [Excess Flood]
sigjuice has quit [Excess Flood]
chris2 has quit [Ping timeout: 265 seconds]
lupine has joined #ocaml
alpen has joined #ocaml
mal`` has joined #ocaml
cschneid has joined #ocaml
sigjuice has joined #ocaml
chris2 has joined #ocaml
sgnb` has quit [Ping timeout: 265 seconds]
jeroud has joined #ocaml
mawuli has joined #ocaml
lopex has joined #ocaml
mort___ has joined #ocaml
AlexRussia has joined #ocaml
ollehar has joined #ocaml
tanguy` has quit [Read error: Connection reset by peer]
hay207 has quit [Quit: Leaving]
<ollehar>
so I'm using menhir for a small template language, but I will need to feed menhir a namespce at execution time. is this possible? e.g., in the lexer.mli file, having a rule like
<ollehar>
| ['a'-'z']
<ollehar>
oops
<ollehar>
| ['a'-'z']+ as i
<ollehar>
{ Module.addVariable namespace i }
Guest95232 is now known as mrknife
<Drup>
1) that's in the lexer
<ollehar>
where `namespace` comes from the host program
<ollehar>
hm
<Drup>
2) you should usually avoid side effects during parsing, really ..
NSA_Agent has joined #ocaml
dkreuter has left #ocaml ["Ex-Chat"]
<ollehar>
and add them in the parser.mly?
<ollehar>
but I still wouldn't be able to parameterize the menhir module?
<ollehar>
not sure that's what's needed :P
<Drup>
why do you need that ?
<Drup>
can't you do it after parsing, when walking this AST ?
<Drup>
(no, you can't really do that cleanly in menhir)
<ollehar>
well, I add variables during parsing of an XML.
<ollehar>
add variables to the namespace
<ollehar>
then I _use_ the variables in the template language
<Drup>
that doesn't seem very LR(1) :]
<ollehar>
LR?
<Drup>
the class of gramar parsed by menhir
<ollehar>
I should have taken that compiler class ><
<ollehar>
anyway
<ollehar>
no, this is pretty much ad hoc, everything
<ollehar>
so I would need a global variable `namespaces` to fetch stuff from, then? hm.
<Drup>
just create a xml structure (using xmlm) and walk it with a custom function
<Drup>
there is no need to rewrite a xml parser to begin with, mostly
<ollehar>
no, that I already have
<ollehar>
this is a "sublanguage"
<ollehar>
I use xml-light
<ollehar>
:)
<ollehar>
(sorry)
<Drup>
right, then parse as xml and rewalk if after
<ollehar>
not sure I understand, but I will read more. thanks anyway, as always :)
mort___ has quit [Quit: Leaving.]
ygrek_ has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
struktured has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
<struktured>
reynir: re: solaris, so far so bad. but made a little progress. if I get a nice build working I will publish it on github.
<reynir>
\o/
ygrek_ has quit [Ping timeout: 252 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Haudegen has joined #ocaml
badkins has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Choups314 has joined #ocaml
A1977494 has joined #ocaml
Haudegen has joined #ocaml
struktured has quit [Ping timeout: 258 seconds]
BitPuffin|osx has quit [Ping timeout: 276 seconds]
nojb- has joined #ocaml
matason has joined #ocaml
Choups314 has quit [Ping timeout: 276 seconds]
Choups314 has joined #ocaml
nullcat_ has joined #ocaml
mort___ has joined #ocaml
palomer has quit [Quit: palomer]
ontologiae_ has quit [Ping timeout: 255 seconds]
<nullcat_>
Drup: have time and have a look at my stackoverflow question?
Choups314 has quit [Ping timeout: 245 seconds]
A1977494 has left #ocaml [#ocaml]
Choups314 has joined #ocaml
<Drup>
I didn't take a proper look yet
<nullcat_>
um..
<nullcat_>
ivg's solution is not lazy...
matason has quit []
palomer has joined #ocaml
adc90 has quit [Read error: Connection reset by peer]
adc90 has joined #ocaml
palomer has quit [Client Quit]
mort___ has quit [Quit: Leaving.]
Choups314 has quit [Ping timeout: 265 seconds]
lambda_foo has quit [Ping timeout: 246 seconds]
badkins has quit []
<yminsky>
Another iocaml question: anyone know if there is good support for generating graphs or other visualizations within iocaml at present?
<yminsky>
it would be nice to be able to hook into javascript libraries that generate interactive visualizations, or python's matplotlib.
<Drup>
the former should be fairly trivial
<yminsky>
I'd ideally like to be able to do so without being restricted to js_of_ocaml. The ordinary iocaml backend is for the most part more flexible, if you don't need to run in the browser.
alexis_ has joined #ocaml
ygrek_ has quit [Ping timeout: 244 seconds]
hilquias has joined #ocaml
<flux>
I just realized about the inline record feature. it doesn't allow type t = { u : { z : int } };, does it?
<flux>
nor for introducing constructors within records :)
<flux>
well, there's something left to the future!
alexis_ has quit [Quit: Quitte]
tmtwd has joined #ocaml
mengu has joined #ocaml
nojb has quit [Quit: nojb]
nojb- has quit [Ping timeout: 240 seconds]
<ggole>
flux: doesn't work with GADTs, either
<Drup>
it works with GADTs
<ggole>
Eh? Did it get changed recently?
<Drup>
I don't think so, no
agarwal1975 has quit [Quit: agarwal1975]
michael_lee has joined #ocaml
<ggole>
Hmm
<ggole>
Well, that's good news
kdef has joined #ocaml
Algebr has joined #ocaml
ingsoc has quit [Ping timeout: 250 seconds]
ingsoc has joined #ocaml
michael_lee has quit [Quit: Ex-Chat]
axiles has joined #ocaml
ontologiae_ has joined #ocaml
axiles has quit [Client Quit]
axiles has joined #ocaml
axiles has quit [Client Quit]
axiles has joined #ocaml
adc90 has quit [Read error: Connection reset by peer]
<nullcat_>
"If he wants people to look at it, he should post it on github" what's wrong with people nowadays...
<Algebr>
github won the mindshare.
ggole has quit []
<dmbaturin>
Github deserves the mindshare it won, as of me.
<mengu>
browsing the code > download tar > extract it > inspect it
<dmbaturin>
I see nothing wrong with uploading tarballs though.
<Unhammer>
could be worse. could be a zip with no subdirectories.
<Unhammer>
and a .DS_STORE file
<Unhammer>
uploaded to github
<dmbaturin>
However, I wish github had some way to structure the repos, other than organizations. Uploading code there is a good way to save it from link rot, but everything in one big list makes account look cluttered.
<Unhammer>
with several different non-printing characters in the filename
<dmbaturin>
Unhammer: ZIP? It could be RAR. Or LHA. Or ARJ.
<dmbaturin>
Speaking of which, MLton actually has SMLNJ library tarball in its git repo.
<Unhammer>
rar with a password :)
<Unhammer>
rar.exe
slash^ has quit [Read error: Connection reset by peer]
<nojb>
but my suggestion is to forget about camlp4 ... it is on its way out
<ncthom91>
nojb oh... hm ok. What would you recommend instead? I'm trying to learn ocaml while practice with compilers by writing all the pieces of the compiler for a toy language
<ncthom91>
i could just use the default stream tools and pick off a char at at ime
<nojb>
ocamlyacc, ocamllex are fine tools to handle the frontend of a compiler
<ncthom91>
nojb hmm that feels like cheating. I want to try writing the lexer manually :)
<nojb>
ok, sure - then don't use any tools just read from a channel and do it by hand -
<Algebr>
eh, lexer is kind of boring, I would just use the tools.
oscar_toro has joined #ocaml
<ncthom91>
Algebr heh. I'm sure i'll fall back onto the tools once I get to more complicated languages. I'm going to write a pretty trivial arithmetic calculator compiler i think just to get experience with each part. Writing a lexer for that can't be too hard
struktured has joined #ocaml
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hilquias has quit [Remote host closed the connection]
ingsoc has quit [Quit: Leaving.]
asQuirreL has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
ollehar has joined #ocaml
rwmjones has quit [Read error: No route to host]
rwmjones has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
dav has joined #ocaml
NSA_Agent has quit [Ping timeout: 252 seconds]
<ncthom91>
can anyone explain Some and None? I don't quite understand them in the context of pattern matching
tmtwd has joined #ocaml
nojb has quit [Quit: nojb]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Gama11_ has quit [Remote host closed the connection]
<ollehar>
ncthom91: Some carries a value, None does not
<ollehar>
use when a function _can_ return something or nothing
<ollehar>
you use it instead of functions that return null in imperative languages
<ollehar>
to destruct:
<ollehar>
match opt_val with
<ollehar>
| Some a -> a
<ollehar>
| None -> some_default_stuff
<ollehar>
or maybe
<ollehar>
| None -> raise (Exception_with_good_message "Bla bla bla")
<dmbaturin>
type 'a option = Some of 'a | None
<dmbaturin>
They are constructors like any other, nothing special.
<ncthom91>
ollehar dmbaturin I see, thanks
<dmbaturin>
Also, "()" is nothing special either, it's the sole constructor of the type unit.
<dmbaturin>
Well, except some parser magic that makes it valid syntax, since you normally can't create a constructor made of special characters. :)
habnabit is now known as _habnabit
NSA_Agent has joined #ocaml
<ollehar>
didn't know :)
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ollehar>
but why not just use "Unit"?
<ollehar>
() is hardly more clear :P
<dmbaturin>
Not sure. Maybe because writing it in "let Unit = do_things Unit" would be annoying. :)
<ollehar>
ah
<ollehar>
so you get the more superficially look of `function_call ()`
Cyanure has quit [Remote host closed the connection]
Kakadu has quit [Remote host closed the connection]
<dmbaturin>
In SML you can create constructors like :: yourself, but I think the () requires magic there too.
<dmbaturin>
Same with Haskell.
ncthom91 has joined #ocaml
kdef has quit [Ping timeout: 245 seconds]
kdef has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ollehar has quit [Ping timeout: 245 seconds]
mengu has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 265 seconds]
logzet has quit [Ping timeout: 255 seconds]
alinab has joined #ocaml
<dmbaturin>
I wonder what a link to a paper about implementing printf in SML is doing in the tutorial list https://ocaml.org/learn/tutorials/
swgillespie has joined #ocaml
<Algebr>
The tutorials need to be cleaned up, some are very opinionated.
lobo has quit [Quit: leaving]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
Haudegen has joined #ocaml
mengu has joined #ocaml
<dmbaturin>
Well, as long as they aren't totally unrelated. :)
<dmbaturin>
Ironically, I wanted this paper today, and I couldn't remember its name and didn't have a saved copy in zotero, so I had to google it with silly queries like "sml printf". And now it's there.
<tokenrove>
that paper does mention caml ;-)
<dmbaturin>
But all the code is in SML. :)
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ollehar has joined #ocaml
<dmbaturin>
Algebr: Which ones you think should be removed?
ollehar has quit [Client Quit]
<dmbaturin>
I'm making a pull request.
asQuirreL has joined #ocaml
<Algebr>
I have to look it up, one was like people that code in java are silly/stupid
asQuirreL has quit [Client Quit]
mengu has quit [Ping timeout: 250 seconds]
<dmbaturin>
To execute the expressions in file myFile.sml (usually definitions that you are testing), use