<RandalSchwartz>
so you could run your webserver on a raspberry pi, and run your browser app as a single-page app written in the same language.
<whitequark>
see ocsigen/eliom for that
q66 has quit [Quit: Leaving]
<whitequark>
it offers seamless data exchange between client and server to combine with the frontend code in ocaml
<RandalSchwartz>
wow
<Drup>
soon, we will have ocsigenserver working very nicely with mirage
<RandalSchwartz>
at least Anil had good things to say about my Perl books. :)
<RandalSchwartz>
that's probably how he tricked me.
<Drup>
so you can have eliom on mirage
<whitequark>
oh, I thought your name sounded similar
<whitequark>
familiar*
<whitequark>
you invented Schwartzian transform, right? :)
<RandalSchwartz>
yeah.. FLOSS Weekly and Perl... my two biggest claims to fame
<RandalSchwartz>
I made it, but didn't name it
<RandalSchwartz>
I'm not that vain
<RandalSchwartz>
I just posted map-sort-map as the answer to a question in the perl newsgroup
<RandalSchwartz>
harking back to my elisp hacking days
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RandalSchwartz>
Tom Christiansen took that post, and gave the pattern a name. my name.
dapz has joined #ocaml
<whitequark>
I see
dapz has quit [Client Quit]
<Drup>
(I didn't know this idiom had a name :O)
englishm has joined #ocaml
dapz has joined #ocaml
<RandalSchwartz>
classic lisp calls it "decorate sort undecorate"
<RandalSchwartz>
I had to use it when I was doing some heavy string processing in elisp
<RandalSchwartz>
I'm not sure if I had seen it done, but it just made sense to me
<RandalSchwartz>
sorting using a comparator, but you also wanted to move other data around according to the sort. makes sense to bundle the data together with the sort key
englishm1 has joined #ocaml
philtor has quit [Ping timeout: 256 seconds]
rick_ has joined #ocaml
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 255 seconds]
<RandalSchwartz>
do the line breaks or indentation matter?
<RandalSchwartz>
it seems like the syntax is self delimiting
<RandalSchwartz>
(explicit ends, etc)
<RandalSchwartz>
I probably skimmed over that earlier.
<whitequark>
whitespace doesn't matter
<RandalSchwartz>
thank goodness.
<RandalSchwartz>
that's one of the things I was starting to hate when I was trying to learn Haskell
<whitequark>
to be frank, ocaml doesn't have a good syntax
<RandalSchwartz>
yeah - it looks a bit clumsy at times
fold has quit [Ping timeout: 245 seconds]
<Drup>
whitequark: do you link Rust's one better ? :p
<RandalSchwartz>
but you're probably talking about things I haven't even started to understand. :)
<RandalSchwartz>
I don't know Rust.
<rick_>
Is there a common solution to a missing gmp.h?
<RandalSchwartz>
I don't know the specifics of gmp in particular, but in general, the "-devel" package of that has to be installed
<RandalSchwartz>
I tend to build everything from source, so I don't often run in to that
<whitequark>
Drup: mostly
<Drup>
whitequark: I dislike < > heavily
<Drup>
and I think they missed some opportunities to make it cleaner, and they will bite their fingers about it later on
<Drup>
(and I'm still not sure how I feel about the fact that you can't define your own operators)
<bernardofpc>
Well, I'm learning Coq, and definetely the "Notation" is nice, but also it layers a TON of abstraction that is sometimes too much to reason about :/
<whitequark>
Drup: not because it looks like C++, but because it is more consistent
<whitequark>
e.g. no ;;
<Drup>
except the "=" in records
<Drup>
this one is going to bite me all the time, I think
travisbrady has joined #ocaml
<rick_>
RandalSchwartz: Thanks. libgmp-dev was the ticket on mint.
jprakash has quit [Ping timeout: 250 seconds]
Denommus has quit [Ping timeout: 250 seconds]
manizzle has joined #ocaml
lostman has joined #ocaml
<RandalSchwartz>
yeah - even though I'm not a linux user, I'm sometimes useful :)
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Denommus has joined #ocaml
<whitequark>
hopefully, soon™ OPAM will be able to detect missing local dependencies automatically
<whitequark>
and offer to install them
darkf has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
darkf has joined #ocaml
penglingbo has quit [Ping timeout: 272 seconds]
jprakash has joined #ocaml
penglingbo has joined #ocaml
maattdd has joined #ocaml
dapz has joined #ocaml
maattdd has quit [Ping timeout: 272 seconds]
dapz has quit [Client Quit]
dapz has joined #ocaml
johnnydiabetic has quit [Quit: Goodbye]
craigglennie has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
jprakash has quit [Ping timeout: 245 seconds]
WraithM has quit [Quit: Lost terminal]
WraithM has joined #ocaml
typedlambda has quit [Ping timeout: 250 seconds]
typedlambda has joined #ocaml
penglingbo has quit [Ping timeout: 245 seconds]
lopex has quit [Quit: Connection closed for inactivity]
fold has joined #ocaml
maattdd has joined #ocaml
ousado_ has joined #ocaml
ousado has quit [Ping timeout: 256 seconds]
maattdd has quit [Ping timeout: 256 seconds]
penglingbo has joined #ocaml
arquebus has joined #ocaml
ruzu has joined #ocaml
arquebus has quit [Quit: Konversation terminated!]
ruzu has quit [Changing host]
ruzu has joined #ocaml
englishm has quit [Remote host closed the connection]
englishm1 has quit [Quit: Leaving.]
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
englishm has joined #ocaml
siddharthv_away is now known as siddharthv
dapz has joined #ocaml
sheijk has quit [Quit: .]
<ruzu>
hello friends! anyone know of any databases developed in ocaml? relational/document/graph/anything?
<Drup>
on the top of my head, there is irmin and obigstore
<Drup>
there are several bindings and type-safe overlays too, but they use existing databases
deavid has quit [Ping timeout: 245 seconds]
bjorkintosh has quit [Ping timeout: 240 seconds]
deavid has joined #ocaml
<ruzu>
thanks for the links, i'll check them out; as a hobby project i'm thinking about developing a "spacial database" (3d principally but ostensibly n-d) server; is this something ocaml would be suited for?
<Drup>
I'm completely incompetent in term of database implementation, but both obigstore's creator ( mfp ) and irmin's one ( samoth / thomasga ) hang here sometime, you may as well ask them.
maattdd has joined #ocaml
bjorkintosh has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
Eyyub has joined #ocaml
craigglennie has quit [Quit: craigglennie]
cantstanya has quit [Remote host closed the connection]
Simn has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
chris2 has quit [Ping timeout: 260 seconds]
chris2 has joined #ocaml
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
<whitequark>
ruzu: use postgres, I would guess
<whitequark>
unless you have a very good reason not to
englishm has quit [Ping timeout: 250 seconds]
Eyyub has quit [Ping timeout: 245 seconds]
ggole has joined #ocaml
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dapz has joined #ocaml
eikke__ has joined #ocaml
badon has joined #ocaml
WraithM has quit [Ping timeout: 264 seconds]
maattdd has joined #ocaml
parcs has quit [Ping timeout: 245 seconds]
maattdd has quit [Ping timeout: 260 seconds]
fraggle_ has quit [Remote host closed the connection]
siddharthv is now known as siddharthv_away
Hannibal_Smith has joined #ocaml
parcs has joined #ocaml
<orbitz>
ruzu: arakoon
<orbitz>
and I'm developing my own although I don't expect it to ever be production worthy
fraggle_ has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
<flux>
ruzu, I like to think OCaml is great for projects involving complicated data structures
michael_lee has joined #ocaml
<flux>
the types help keep the developer in the bay ;-)
<flux>
though it can be a dnager as well, you might end up with more complicated data structures, because they are manageable ;-)
<orbitz>
the memory layout is also very predictable
<flux>
though you won't have the control over it like in C++. but you also will have less boilerplate and other issues to deal with in my experience..
<Hannibal_Smith>
It would be nice if Ocaml would let the developer choice the memory layout
<Hannibal_Smith>
Haskell can do it with GHC pragma
WraithM has joined #ocaml
cago has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<mrvn>
Hannibal_Smith: write a pluggable GC
<whitequark>
I wonder if it makes sense to write an OCaml GC in OCaml
<mrvn>
whitequark: then who GCs the GC?
sagotch has joined #ocaml
<whitequark>
it should not allocate.
<whitequark>
well, not on heap.
<ggole>
It's been done: T (a scheme implementation) was written mostly in itself
<whitequark>
I've been thinking of Maxine, but, yes
<ggole>
You have to be pretty careful with closures
<mrvn>
I think the Obj module doesn't giv you access to the extra GC bits in the header of a box
<ggole>
OCaml would make that even more difficult, as it allocates unless you fully lambda lift by hand. :(
<whitequark>
I suppose the compiler could be made smarter.
<ggole>
Yeah, it's solvable.
<whitequark>
mrvn: that can be easily fixed :)
Youri has joined #ocaml
<mrvn>
you would still get values on the stack that then get added to the root set so the GC loops on itself
<whitequark>
not if the values are unboxed.
<mrvn>
the values are pointers to the users data structures.
<ggole>
Why would you scan that part of the stack?
<whitequark>
oh, well, why'd you walk the stack from the top of it? walk it from the GC entry point
<ggole>
Seems like a silly thing to do.
<mrvn>
because the compiler doesn't know you are running a GC
<NoNNaN>
runtime type representation would probably also need
<flux>
I'm not sure if I agree with doing things for the sake of doing it, current gc works fine ;-)
<ggole>
The compiler doesn't have to know anything
<flux>
well, unless the new GC also happened to be thread-friendly
<whitequark>
mrvn: the GC would know it
<whitequark>
flux: to remove the last bits of C from mirage!
<flux>
whitequark, yeah.. soo.. for the sake of doing it ;-)
<flux>
I think it's better to spend effort on things that have not yet been done ;-)
<ggole>
Although you might want to tag GC routines to avoid constructing useless frames for them
<NoNNaN>
if a gc could written in the language (dsl like) it could provide lot's of value
<flux>
I doubt it would be faster than what we currently have. in fact, probably slightly slower..
<mrvn>
I think a better thing would be to rewrite the multithreading support
<flux>
that's a pretty nice whitepaper, but it's completely different from doing GC :)
<flux>
I wonder if it has been producticed, I think people could find use for it
<NoNNaN>
flux: it depends on representation
<flux>
for the benefit of those who haven't read it, the approach is basically copying (was it directly from net interwork interface) packets (headers only?) to the GPU which does packet decision in batches of N packets
<NoNNaN>
flux: with enough computing problem almost anything could be translated to io problem (this is what hpc do)
<NoNNaN>
computing power
<whitequark>
NoNNaN: very interesting
<ggole>
So you have to wait for N packets? What does that do for latency?
<NoNNaN>
whitequark: there is a paper, where operating system guys talking about why the operating system needs gpu task abstractions, and they implemented their own driver in the linux kernel
<NoNNaN>
the driver accepts ptx binaries, and used it later for lot's of other project, but I haven't found the paper yet with the github repo url
<NoNNaN>
ggole: it depends on arrival rate, if you only have a few packets than you do it on the cpu
Eyyub has joined #ocaml
<NoNNaN>
but back to the gc, some offloading could improve the current status
Anarchos has joined #ocaml
<NoNNaN>
is there any way to extract the gc graph from the runtime ?
<NoNNaN>
or create a shadow gc structure
<mrvn>
The hard part is: When all you have is a hammer then you need to make all your problems be nails.
<mrvn>
whitequark: which it is since we have shared memory :)#
<whitequark>
since GPU is a PCI-e bus master on x86
<Hannibal_Smith>
<mrvn> Hannibal_Smith: write a pluggable GC <-I will take that as "Please don't make request about choice the memory layout of your data in Ocaml"
<mrvn>
Hannibal_Smith: no, that was a reference to that the GC depends on the memory layout and you need to write a new one if you change it
<NoNNaN>
whitequark: to test the water you need some data structures, so it could be counterproductive to start it
<mrvn>
whitequark: I think all the arm boards with embedded gpu use shared memory and the AMD APUs I bet too.
_tca has quit [Read error: Connection reset by peer]
strmpnk has quit [Ping timeout: 256 seconds]
_tca_ has joined #ocaml
strmpnk has joined #ocaml
sagotch has joined #ocaml
fold has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
George_ has joined #ocaml
agarwal1975 has joined #ocaml
fold has joined #ocaml
thomasga has quit [Quit: Leaving.]
siddharthv is now known as siddharthv_away
sgnb has joined #ocaml
_andre has joined #ocaml
ollehar1 has joined #ocaml
ollehar1 has quit [Ping timeout: 250 seconds]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
_0xAX has joined #ocaml
<orbitz>
whitequark: does your protobuf solution care about the order of things?
typedlambda has quit [Ping timeout: 250 seconds]
ygrek has quit [Ping timeout: 240 seconds]
<whitequark>
no
typedlambda has joined #ocaml
Kakadu has joined #ocaml
lopex has joined #ocaml
ddosia has quit [Quit: Leaving.]
Arthur_Raibow has quit [Ping timeout: 240 seconds]
<companion_cube>
whitequark: so you have deriving json currently?
<companion_cube>
or it's not implemented yet?
Thacib has joined #ocaml
<whitequark>
companion_cube: not yet, it's next on schedule
<companion_cube>
nice
<whitequark>
I'm currently porting ppx_protobuf
<companion_cube>
can't wait for 4.02 to be released
<whitequark>
which is now ppx_deriving_protobuf
Eyyub has quit [Quit: WeeChat 0.4.1]
<whitequark>
wow, I wrote some ungodly coe
<whitequark>
code*
<companion_cube>
:D
<companion_cube>
did you look at my GADT-based thingie?
<whitequark>
at least it has good test coverage
<whitequark>
not yet
thomasga has joined #ocaml
troydm has quit [Ping timeout: 250 seconds]
oriba has joined #ocaml
sagotch has quit [Remote host closed the connection]
ddosia has joined #ocaml
huza has joined #ocaml
<whitequark>
oh, I forgot about option, list and array >_<
<companion_cube>
hmmmm
pgomes has joined #ocaml
ebzzry_ has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
englishm has joined #ocaml
englishm_ has joined #ocaml
Thacib has quit [Quit: Lost terminal]
darkf has quit [Quit: Leaving]
troydm has joined #ocaml
sad0ur has quit [Quit: leaving]
rand000 has quit [Ping timeout: 240 seconds]
<George_>
Anyone familiar with the notaion >|= ?
<whitequark>
yes, it's monadic map
<def`>
Usually it's just another name for map
<George_>
thanks
michael_lee has quit [Remote host closed the connection]
<companion_cube>
just map, yes
penglingbo has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
ygrek has joined #ocaml
rand000 has joined #ocaml
pgomes has left #ocaml [#ocaml]
Simn has quit [Ping timeout: 240 seconds]
RandalSchwartz has quit [Remote host closed the connection]
philtor has joined #ocaml
_0xAX has quit [Remote host closed the connection]
morphles has joined #ocaml
zpe has quit [Remote host closed the connection]
arj has quit [Quit: Leaving.]
badon_ has joined #ocaml
philtor has quit [Ping timeout: 250 seconds]
philtor has joined #ocaml
badon has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
shinnya has joined #ocaml
badon_ is now known as badon
<Drup>
pfiou, the icpf conquest :O
<whitequark>
Drup: how would you call a plugin that converts variants to int, from int (only parameterless) and to string / from string (only parameterless) ?
<whitequark>
hm. ToInt, FromInt, ToString and FromString, duh
<whitequark>
or To_int?
<ggole>
Int/String_of_constructor
<ggole>
Bit wordy.
<whitequark>
no, too long
travisbrady has joined #ocaml
<Kakadu>
Enum, Show?
<whitequark>
Enum?..
<whitequark>
oh, Enum is good choice
<companion_cube>
whitequark: so, how does one add a deriving extension?
<companion_cube>
if I wanted to add deriving(ToSeq) ?
<companion_cube>
all this just by linking with 'ppx_deriving'? :>
<whitequark>
um, yes?
<whitequark>
you don't even need to link it in, builtin derivers don't have runtime components
<companion_cube>
maybe I'll start using some syntax extensions then
MercurialAlchemi has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 264 seconds]
BitPuffin has quit [Ping timeout: 256 seconds]
hhugo1 has joined #ocaml
hhugo has quit [Ping timeout: 256 seconds]
jonludlam has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
<Drup>
companion_cube: I don't think there is a point not using ppxs
<companion_cube>
if the build system doesn't make it a nightmare, why not
<Drup>
if the build system makes it a nightare, the issue is in the build system >_>
Kakadu has quit [Quit: Page closed]
AltGr has left #ocaml [#ocaml]
\q has joined #ocaml
AltGr has joined #ocaml
<companion_cube>
sadly the issue is in all build systems I know in OCaml
<Drup>
?
<nlucaroni>
that's awesome, thanks whitequark
<Drup>
camlp4's issues were not related to building
<Drup>
it was correctly integrated into most build systems, once you use ocamlfind
<companion_cube>
well it was even more complicated to build with camlp4 than without
jonludlam has joined #ocaml
zpe has joined #ocaml
smondet has quit [Ping timeout: 240 seconds]
gal_bolle has joined #ocaml
tane has joined #ocaml
penglingbo has quit [Ping timeout: 255 seconds]
badon has quit [Ping timeout: 240 seconds]
badon has joined #ocaml
_tca_ is now known as _tca
_tca has quit [Changing host]
_tca has joined #ocaml
_tca has joined #ocaml
stevej has joined #ocaml
WraithM has joined #ocaml
dsheets_ has quit [Ping timeout: 240 seconds]
englishm1 has joined #ocaml
englishm has quit [Read error: Connection reset by peer]
englishm_ has quit [Read error: Connection reset by peer]
englishm has joined #ocaml
<companion_cube>
it would be interesting to have an annotation for closed functions
<companion_cube>
sometimes it would catch bugs in my recursive definitions...
jonludlam has quit [Ping timeout: 260 seconds]
mcclurmc has joined #ocaml
George_ has quit [Ping timeout: 246 seconds]
jwatzman|work has joined #ocaml
ocp has joined #ocaml
vfoley- has joined #ocaml
<vfoley->
Does OCaml support local types? I.e. let my_func () = let type t = A | B | C in expr
<Armael>
no
<vfoley->
Thank you :)
<ggole>
You can sort of do that with first-class modules
<Armael>
i don't know what would be the consequencies of adding this
<ggole>
let f () = let module M = struct type t = A | B | C end in ...
<ggole>
Doesn't seem like it would make for particularly clear code.
<vfoley->
Interesting alternative.
WraithM has quit [Ping timeout: 245 seconds]
<ggole>
Usually you should be able to hide internal types with a .mli
<vfoley->
ggole: use case: I have a function that recurses on an AST and I need to know if I'm inside or outside a loop. Using a bool confuses me, so I am currently using type loop_location = Inside | Outside, but since it's useful only for this one function, I was wondering if I could make it local.
<Drup>
use a poly variant for this kind of case
<vfoley->
In any case, it's not a very big deal, I was just curious; I'm pretty sure SML has that feature from when I took a prog. lang. class.
<Drup>
`Inside and `Outside
slash^ has quit [Read error: Connection reset by peer]
<Drup>
no need to declare the type
<vfoley->
Drup: ooh, never even thought of that.
<vfoley->
Good idea.
<ggole>
Yeah, if you just have two cases polymorphic variants are perfect.
WraithM has joined #ocaml
BitPuffin has joined #ocaml
thomasga has quit [Quit: Leaving.]
AltGr has left #ocaml [#ocaml]
thomasga has joined #ocaml
olauzon has quit [Ping timeout: 245 seconds]
olauzon has joined #ocaml
AltGr has joined #ocaml
olauzon has quit [Client Quit]
AltGr has left #ocaml [#ocaml]
_0xAX has joined #ocaml
smondet has joined #ocaml
leowzukw has joined #ocaml
thomasga has quit [Ping timeout: 264 seconds]
<leowzukw>
I have successfully parsed a json file using Yojson and I would like to modify some value. Or can I do this?
olauzon has joined #ocaml
<smondet>
leowzukw: you have a Yojson.t right? then just do a traversal of the datastructure "copying" everything except the modification
<smondet>
dunno if i'm clear
<leowzukw>
ok I try
Hannibal_Smith has joined #ocaml
olauzon has quit [Quit: olauzon]
<leowzukw>
smondet: I get values of type Yojson.Safe.json or Yojson.Basic.json. Is it normal?
<smondet>
yes
<smondet>
a big polymorphic variant
<leowzukw>
smondet: I'm starting with ocaml, I do not see how to copy everything.
<leowzukw>
smondet: Could you show me how to do?
olauzon has joined #ocaml
thomasga has joined #ocaml
olauzon has quit [Quit: olauzon]
philtor has joined #ocaml
<smondet>
leowzukw: there is Json chapter in "real world ocaml"
<leowzukw>
I already read it and use it to parse json file but I could not see howto modifie a value
<smondet>
do you see how the `map` function would be written for a list or a tree?
<smondet>
do the same for `json`
<smondet>
then add a special case for the one you want to modify
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
olauzon has joined #ocaml
<leowzukw>
smondet: Could you show me the code please, I tried and it didn't work
philtor has quit [Ping timeout: 245 seconds]
tobiasBora has quit [Ping timeout: 256 seconds]
<smondet>
leowzukw: sorry I don;t have anything at hand right now
<Drup>
At least, it's syntactically correct. Never used yojson, so can't help more than that
<Drup>
but it's probably going to explode as soon as you try to modify some json that doesn't conform to this schema, so you should add another case in your match
<leowzukw>
I get this error when I run Yojson.Basic.Util.map modify json_file;;
<leowzukw>
Error: This expression has type ([< `Assoc of (string * [< `Int of int | `List of 'b ]) list ] as 'a) -> [> `Assoc of (string * [> `Int of int | `List of 'b ]) list ]
<leowzukw>
but an expression was expected of type Yojson.Basic.json -> Yojson.Basic.json
<leowzukw>
Type 'a is not compatible with type
<leowzukw>
Yojson.Basic.json =
<leowzukw>
[ `Assoc of (string * Yojson.Basic.json) list
<leowzukw>
| `Bool of bool
<leowzukw>
| `Float of float
<leowzukw>
| `Int of int
<leowzukw>
| `List of Yojson.Basic.json list
<leowzukw>
| `Null
<leowzukw>
| `String of string ]
<leowzukw>
The first variant type does not allow tag(s) `Bool, `Float, `Int, `List, `Null, `String
<Drup>
It's the compiler version of "you are not handling all the cases that you should"
<leowzukw>
so I ad | _ -> ...
<def`>
add a | _ -> failwith "Case not handled" at the end :P
<leowzukw>
ok thank you
<Drup>
err, I would add "| _ -> arg" instead
<Drup>
you don't want to fail an all the json except the one you want to modify, you just to modify your thing. at least I think.
<def`>
Yep, probably :)
olauzon has joined #ocaml
<leowzukw>
I get
<leowzukw>
Exception: Yojson.Basic.Util.Type_error("Can't map function over non-array type object", _).
<leowzukw>
Did I forget something ?
<def`>
That's quite clear?
<def`>
You are passing invalid input to Yojson
<def`>
(it's expecting an array (that is something of the form `List _))
<leowzukw>
Yes but I don't want to modify only an array
<def`>
To modify something you need to know the shape of this something ? :)
<Drup>
(arguably, if map only accepts an array, the type of map is wrong)
<leowzukw>
Ok never mind, thank you everybody, I'm gotta go
<leowzukw>
I'll try again latter
<def`>
Ok, see you
leowzukw has quit [Quit: leaving]
olauzon has quit [Ping timeout: 260 seconds]
englishm2 has joined #ocaml
englishm_ has joined #ocaml
olauzon has joined #ocaml
ebzzry_ has joined #ocaml
englishm has quit [Ping timeout: 245 seconds]
englishm1 has quit [Ping timeout: 256 seconds]
troydm has joined #ocaml
arjunguha has joined #ocaml
thomasga has quit [Quit: Leaving.]
BitPuffin has quit [Ping timeout: 260 seconds]
philtor has joined #ocaml
gal_bolle has quit [Ping timeout: 260 seconds]
BitPuffin has joined #ocaml
BitPuffin has quit [Client Quit]
Anarchos has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
philtor_ has joined #ocaml
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
arjunguha has joined #ocaml
Thooms has joined #ocaml
arjunguha has quit [Client Quit]
arjunguha has joined #ocaml
nojb has joined #ocaml
_0xAX has quit [Remote host closed the connection]
badon has quit [Ping timeout: 245 seconds]
tani has joined #ocaml
badon has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
tane has quit [Ping timeout: 260 seconds]
Hannibal_Smith has quit [Read error: Connection reset by peer]
philtor_ has quit [Ping timeout: 256 seconds]
Algebr has joined #ocaml
nojb has quit [Ping timeout: 240 seconds]
<Algebr>
What's the purpose of camlp4? what problem does it solve
Hannibal_Smith has joined #ocaml
<oriba>
ocaml-sqlite's db_close always gives me back false
<oriba>
is this a bug?
<oriba>
the db could not be busy
<oriba>
its only my small script accessing it.
<Drup>
Algebr: syntax extensions in general, it's quite large
<Algebr>
Drup: so sugar?
<Drup>
well, it can be more than sugar
<Drup>
you could embed a dsl and do compile time manipulation on it, for exemple
<Drup>
(that what SPOC does, iirc)
olauzon has quit [Quit: olauzon]
<Drup>
(that's what SPOC do*)
<Algebr>
When people say a DSL, do they mean and actual new language? or do they mean some library whose API calls look like fluent interfaces?
<Drup>
both :p
<Drup>
usually, with camlp4, it's more the former
<Algebr>
so camlp4 is not formally part of the ocaml language spec?
<Drup>
well, camlp4 is a way to extend the language with *anything*
<Algebr>
whoa.
<mrvn>
When I hear DSL I think modem
<Algebr>
So since ocaml ecosystem has ocamlbuild, do ya'll not use make?
<Drup>
technically, camlp4 is just a parser engine with some facilities to emit ocaml code
Submarine has quit [Remote host closed the connection]
<Drup>
Algebr: build systems are a delicate debate.
<Algebr>
Drup: Can I get documenation within utop more than just the type signal of a function?
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Drup>
no
<Algebr>
so when I see people using ;, it really just means execute this expression because I want the side effect, then do this next thing?
<Drup>
yes
<Algebr>
I'm still confused about the purpose of the and keyword.
<Drup>
just multiple definitions
<Drup>
let rec f x = if x > 4 then g x else x + 1
<Drup>
and g x = if x mod 2 = 0 then f x else x/2
<def`>
yep, for mutually recursive functions
<Algebr>
wait, does get also get a rec?
<Algebr>
g*
<Drup>
hum ?
<Drup>
yes
<Algebr>
g is also a recursive function?
<Algebr>
ah, so you save typing let rec with just an and
<def`>
no you don't
<def`>
the meaning is different: with and, f sees g and g sees f
<def`>
with two let rec, you impose an ordering
<Algebr>
what ordering
<def`>
the first definition can't see the second
<Algebr>
ahhh, light bulb went off.
<bernardofpc>
I love this expression
<Algebr>
that's because ocaml does things from top to bottom?
<bernardofpc>
(because, technicaly, it's on)
<bernardofpc>
Algebr: yes
<bernardofpc>
every statement can only depend on previous ones
badon has quit [Ping timeout: 256 seconds]
<bernardofpc>
if you add "rec", it can depend on itself
<def`>
(except within an and, where all statements in the same "and" are conceptually treated at the same "time")
<bernardofpc>
so if you want two mutually recursive functions, you have to bring both into context "at the same time", therefore you need "and"
<bernardofpc>
(two /or more/, of course)
<mrvn>
or you pass one as closure ot the other
<def`>
and "and" applies to let, types, classes, recursive-modules, etc.
badon has joined #ocaml
<ggole>
I thought classes didn't have that
<mrvn>
i think with classes you have to put them into recursive modules
<ggole>
Nope, they can.
<ggole>
I should just stop pretending I know the first thing about the object system.
<def`>
class a = object method new_b = new b end and b = object method new_a = new a end;;
<def`>
and, if classes aren't generally a good thing, recursive modules are definitely to avoid :P
_andre has quit [Quit: leaving]
<Algebr>
What does an error message of "this comment contains an unterminated string literal" mean
<Algebr>
oh, nvm, figured it out
<Algebr>
ha
<def`>
there is an unclosed " somewhere :)
<Algebr>
not sure why it cares about that
<ggole>
I've used recursive modules once, and it was a mistake.
<def`>
Algebr: because comments can contains code and can be nested
<mrvn>
sometimes you must
gal_bolle has joined #ocaml
<Algebr>
def`: wat? comments contain code??
<def`>
Algebr: which will be ignored but should still be lexically correct
<def`>
(* (* *) *) <- nested comments
<def`>
(* "(*" *) <- string inside comment, not nested
<Algebr>
1) What is the purpose of nested comments 2) I thought the lexer immediately just threw out everything in a comment, that it didn't even look what's inside a comment
<def`>
1) commenting code
<mrvn>
Algebr: so you can comment out a block of code that already contains comments
<def`>
2) Well it has to find the end of the comment, and in the meantime it looks for nested comments
<mrvn>
I didn't know it parsed strings inside comments though
<Algebr>
still not seeing the utility of nested comments. Commented out lines are already commented out, whats the utility of adding another layer.
<mrvn>
Algebr: say you have a block of 10 lines of codes with comments and you want to disable it
<def`>
mrvn: because (* inside strings are not comments, even within comments… (ouch)
<mrvn>
def`: it makes sense. still didn't know it though
<smondet>
Algebr: nested comments can be useful also for ocamldoc, documentation can contain code examples, with comments themselves
<bernardofpc>
what parts of the parser still work inside comments ?
<def`>
bernardofpc: none
<bernardofpc>
(or better asked, is there some page describing the behaviour of the parser ?)
<def`>
bernardofpc: nested comments are handled by the lexer
<bernardofpc>
excuse my bad CS background
<mrvn>
bernardofpc: everything needed so you can take any block of code and comment it out I bet.
<bernardofpc>
mrvn: well, that's reasonable, but I'd like to have a description, not implementation-defined behaviour ;-)
<bitbckt>
that just needs a stack for tracking open/close scopes, which is in the lexer.
<mrvn>
.oO(half of ocaml is implementation defined :)
<bernardofpc>
(I'm not a language guru to find all corner cases that the real ones would have thought about...)
<bernardofpc>
sigh
<def`>
half… It's a kind approximation :D
<bernardofpc>
still, there are many pages that describe the syntax of language constructs
<Algebr>
this stuff: [< Foo | Bar], still looks weird to me.
<Drup>
Algebr: it's normal, it's going to look weird for a few month
<bernardofpc>
(as they've done for Identifiers just below :/)
<bitbckt>
"Nested comments are handled correctly." <- lol
<bitbckt>
"works as written"
gal_bolle has quit [Ping timeout: 240 seconds]
<bernardofpc>
def`: you could suggest your 4 examples above to people responsible for the site for clarifying what the two sentences about strings & comments mean when put together
<bernardofpc>
in many languages, (* " *) would sound reasonable
axiles has quit [Remote host closed the connection]
gal_bolle has joined #ocaml
<oriba>
... ah, after finalizing my sqlite-db's stmt, clsoing also works ... more documentation would be fine for that lib...
gal_bolle has quit [Client Quit]
<Drup>
stmt ?
<def`>
Drup: precompiled queries in SQLite parlance
zpe has quit [Remote host closed the connection]
<Drup>
oh, those.
<mfp>
oriba: you might want to take a look at ocaml-sqlexpr
agarwal1975 has quit [Quit: agarwal1975]
<oriba>
mfp, hmhhh, which advantages does it offer?
<mfp>
oriba: it automates prepared stmt caching, param binding, data extraction, error checking...
<oriba>
aha, hmhh
<mfp>
provides HOFs like iter and fold over SQL rows, explicit support for Lwt (in case you use the latter), etc
Hannibal_Smith has quit [Quit: Sto andando via]
nlucaroni has left #ocaml [#ocaml]
<oriba>
sounds nice
<oriba>
is it mature already?
<mfp>
I'd say so... been using/working on it for 4 years
ggole has quit []
Kakadu has quit [Quit: Konversation terminated!]
englishm_ has quit [Remote host closed the connection]
englishm2 has quit [Quit: Leaving.]
englishm has joined #ocaml
englishm has quit [Ping timeout: 245 seconds]
jonludlam has joined #ocaml
agarwal1975 has joined #ocaml
zpe has joined #ocaml
travisbrady has quit [Quit: travisbrady]
q66 has joined #ocaml
Thooms has quit [Read error: Connection reset by peer]
Thooms has joined #ocaml
ollehar1 has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
zpe has quit [Remote host closed the connection]
ocp has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
travisbrady has joined #ocaml
arjunguha has joined #ocaml
pyon has quit [Quit: stupid emacs]
pgomes has joined #ocaml
pgomes has quit [Client Quit]
jonludlam has quit [Remote host closed the connection]
cago has joined #ocaml
q66_ has joined #ocaml
tani has quit [Quit: Verlassend]
pyon has joined #ocaml
q66 has quit [Ping timeout: 260 seconds]
sad0ur has joined #ocaml
fold has quit [Ping timeout: 250 seconds]
Thooms has quit [Quit: WeeChat 0.3.8]
cantstanya has joined #ocaml
Algebr has quit [Ping timeout: 256 seconds]
Simn has quit [Quit: Leaving]
rand000 has quit [Quit: leaving]
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 256 seconds]
arjunguha has joined #ocaml
shinnya has joined #ocaml
thomasga has joined #ocaml
englishm has joined #ocaml
englishm_ has joined #ocaml
cago has quit [Quit: cago]
ebzzry_ has quit [Ping timeout: 240 seconds]
tobiasBora has joined #ocaml
darkf has joined #ocaml
_JokerDoom has joined #ocaml
fold has joined #ocaml
agarwal1975_ has joined #ocaml
vfoley_ has joined #ocaml
clog_ has joined #ocaml
ebzzry has joined #ocaml
mbac_ has joined #ocaml
marky_ has joined #ocaml
wormphle1m has joined #ocaml
binarybi1me has joined #ocaml
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 256 seconds]
agarwal1975 has quit [*.net *.split]
bjorkintosh has quit [*.net *.split]
vfoley- has quit [*.net *.split]
JokerDoom has quit [*.net *.split]
mbac has quit [*.net *.split]
binarybitme has quit [*.net *.split]
wormphlegm has quit [*.net *.split]
marky has quit [*.net *.split]
clog has quit [*.net *.split]
NoNNaN has quit [*.net *.split]
studybot has quit [*.net *.split]
agarwal1975_ is now known as agarwal1975
bjorkintosh has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
englishm_ has quit [Remote host closed the connection]