<yminsky>
Anyone know how to force opam to use a specific revision of a repository that you've added to it?
pierpa has quit [Ping timeout: 244 seconds]
Heasummn has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
gustav___ has quit [Ping timeout: 265 seconds]
gustav___ has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 250 seconds]
d0nn1e has quit [Ping timeout: 240 seconds]
d0nn1e has joined #ocaml
sveit has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
Orion3k has quit [Ping timeout: 260 seconds]
Orion3k has joined #ocaml
unbalancedparen has quit [Ping timeout: 240 seconds]
phase_ has quit [Quit: cya l8r alig8r]
FreeBirdLjj has joined #ocaml
<bruce_r>
what do you need to put in your .merlin to make it find the .ml files in the same directory? I added the line 'S .', and when I open emacs there's a message saying that it is the current directory, but when I open an other file it doesn't recognize it
bruce_r has quit [Remote host closed the connection]
bruce_r has joined #ocaml
pyon has quit [Quit: Fix config.]
jeffmo has quit [Quit: jeffmo]
unbalancedparen has joined #ocaml
pyon has joined #ocaml
Heasummn has quit [Quit: Leaving]
fedruantine has quit [Ping timeout: 244 seconds]
seangrove has quit [Ping timeout: 265 seconds]
fedruantine has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
ygrek_ has joined #ocaml
f[x] has quit [Ping timeout: 244 seconds]
tmtwd has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
govg has quit [Ping timeout: 258 seconds]
MercurialAlchemi has joined #ocaml
ygrek_ has quit [Ping timeout: 265 seconds]
g4143 has joined #ocaml
g4143 has quit [Client Quit]
FreeBirdLjj has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Ping timeout: 258 seconds]
groovy2shoes has quit [Ping timeout: 255 seconds]
ygrek_ has joined #ocaml
Algebr` has joined #ocaml
Mercuria1Alchemi has joined #ocaml
FreeBirdLjj has joined #ocaml
slash^ has joined #ocaml
igitoor has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
f[x] has joined #ocaml
Algebr` has quit [Read error: Connection reset by peer]
ygrek_ has quit [Ping timeout: 276 seconds]
AlexRussia has quit [Ping timeout: 244 seconds]
tane has joined #ocaml
Xizor has joined #ocaml
Mercuria1Alchemi has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
igitoor has joined #ocaml
Mercuria1Alchemi has joined #ocaml
igitoor has quit [Changing host]
igitoor has joined #ocaml
govg has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
manizzle has quit [Remote host closed the connection]
bruce_r has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
Xizor has quit [Read error: Connection reset by peer]
AltGr has joined #ocaml
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Algebr` has joined #ocaml
zpe has joined #ocaml
FreeBirdLjj has joined #ocaml
SpaceSheep has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
_2can has quit [Quit: Lost terminal]
FreeBirdLjj has joined #ocaml
jwatzman|work has joined #ocaml
Reperator has joined #ocaml
Reperator has quit [Client Quit]
f[x] has quit [Ping timeout: 265 seconds]
Anarchos has joined #ocaml
rwmjones_hols is now known as rwmjones
sh0t has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
<freehck>
People, I have a strange behaviour. There's an Ocs library which provides me with Ocs_types module. "ocamlfind query ocs" can find an installed ocs in my .opam directory. But when I try to build my project with command "ocamlbuild -use-ocamlfind my-prog.native" the module that uses Ocs_types fails to find it. Why?
<freehck>
I've described package(ocs) for <*.ml> in the _tags file...
<Algebr`>
what's ocs
<freehck>
ocaml scheme
<freehck>
it's more powerful that sexplib
<freehck>
*than
<Algebr`>
silly question, have you checked opam switch, does it say environment out of sync?
<Drup>
freehck: replace <*.ml> by "true"
<Algebr`>
ah
<freehck>
Drup: replaced
<freehck>
Well, I still don't understand why ocamlbuild can't locate my ocs... :/
<def`>
a first step to help would be to upload a log with the exact error message
<def`>
freehck: I strongly suggest using a local opam switch to a system switch :P
<freehck>
Do I need *.ml to include this module, not just open?
<def`>
hum?
<freehck>
oh... I really use system switch...
<freehck>
def`: what's the difference between local 4.01.0 switch and system one?
* freehck
is switching right now.
jtmcf has quit [Ping timeout: 250 seconds]
<def`>
freehck: system switch is managed by your distribution
<def`>
the problem is that opam cannot track changes made by package manager
<def`>
hence system switch can break somewhat randomly
<freehck>
ok
<freehck>
def`: btw, some time ago opam started to print me "[ERROR] ocaml-verison is not a valid variable."
<freehck>
What is it about?
<freehck>
Well everything seems to work fine despite of this message.
<def`>
freehck: your version of opam is too old I guess?
<freehck>
def`: default from the debian jessie repo.
<freehck>
I'll look for a backport later so,.
<def`>
opam --version
<Khady>
it's 1.2.0 in jessie IIRC
<freehck>
yes, 1.2.0
jtmcf has joined #ocaml
<freehck>
def`: I have switched to local 4.01.0 but nothing has changed for ocs module.
<freehck>
It's still installed the same path btw.
<def`>
eval `opam config env`
<freehck>
of course
<def`>
opam install findlib
<def`>
ach
<def`>
sorry, opam install ocamlfind
<freehck>
aaaah...
<freehck>
yes, i forgot it
<freehck>
I always forget it. :)
<def`>
this two layer dance (distrib + opam) is very confusing
<freehck>
wow! it works now.
<freehck>
oh, no.
<def`>
haha
<freehck>
I've just typed the wrong command. It still can't find Ocs_types.
<def`>
opam install ocamlbuild?
<def`>
(& opam install ocs of course :P)
<freehck>
ocamlbuild is already installed
<freehck>
ocs is not in opam
<freehck>
ocs used "ocamlfind install ocs ..."
<def`>
ahh
<def`>
that's a problem
<freehck>
Maybe it's easier to remove it from .opam/4.01.0 and just to put the whole thing into my repository?
<freehck>
then add "<ocs> : include" into _tags..
<def`>
yep
tane has quit [Quit: Leaving]
octachron has joined #ocaml
<freehck>
hm... now "package ocs not found".
<freehck>
it's worse than ocs_types not found... =/
<def`>
well that's obvious
<def`>
you don't have ocs installed
<freehck>
aaah
<freehck>
I don't need to specify in in package(...)
<def`>
not if you bundle the source :)
sepp2k has joined #ocaml
<freehck>
The same problem. Ocs_types has no implementations.
<freehck>
But I found an interesting thing.
<freehck>
If I change include to open it will compile fine.
<freehck>
But I specifically want to include to import all the inderfaces of ocs_types...
<def`>
Ahah, interesting.
<def`>
Ocs_types has no implementation :/
<def`>
Should have checked that right at the beginning, sorry.
<freehck>
Okay. Thank you, def`. I think I've just spent enough of your time. I'll just open Ocs_types in all the appropriate modules, and open Sexp in all of them too.
<freehck>
Will try to find out the better solution while the weekend.
<def`>
the "proper" fix would to rename ocs_types.mli to ocs_types.ml
<freehck>
def`: right in the install dir?
<def`>
freehck: and compile it
<def`>
yes
<freehck>
thank you, I'll try it later.
sdothum has joined #ocaml
g4143 has joined #ocaml
yegods has quit [Remote host closed the connection]
g4143 has quit [Client Quit]
thegameg has joined #ocaml
_andre has joined #ocaml
al-maisan_ has quit [Ping timeout: 250 seconds]
al-maisan has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
_2can has joined #ocaml
malc_ has joined #ocaml
malc_ has quit [Client Quit]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
_y has joined #ocaml
pierpa has joined #ocaml
rgrinberg has joined #ocaml
orbifx-m has joined #ocaml
<orbifx-m>
Why do C threads have to be registered with the run-time systsem? Manual 19.11.1?
brab has quit [Ping timeout: 265 seconds]
brab has joined #ocaml
<mrvn>
orbifx-m: they only need to be registered when C creates a threads and you want to call ocaml from it.
kushal has joined #ocaml
<mrvn>
orbifx-m: the GC needs to scan it's roots when it runs.
<orbifx-m>
And how is it assisted by the knowledge of the thread?
brab has quit [Ping timeout: 244 seconds]
brab has joined #ocaml
rgrinberg1 has joined #ocaml
govg has joined #ocaml
rgrinberg has quit [Ping timeout: 258 seconds]
brab has quit [Ping timeout: 240 seconds]
agarwal1975 has joined #ocaml
brab has joined #ocaml
ggole has joined #ocaml
<mrvn>
orbifx-m: it just creates a new thread root and adds it to the list.
<orbifx-m>
mrvn?
Hakey has joined #ocaml
<mrvn>
orbifx-m: the GC has a list of all threads and when it does a collection it iterates over all the threads and marks their memory.
<orbifx-m>
Ok this raises another of my questions. 'Root' is used in the manual but not defined. So what are roots? The first 'layer' of values in memory?
<ggole>
Roots are immediately live values
<ggole>
Immediate in the sense that the program can depend on their value without going through another object to get to them
<mrvn>
Think of the ocaml values as a directed graph. The GC takes all the roots, picks them up and shakes. Anything that falls out is not alive.
<mrvn>
You make roots for any global value that's always alive or for every stack frame because they aren't kept alive by other ocaml values so you have to do that manually.
<orbifx-m>
It's coming together now. Are root values ever in stack? Or always in heap?
<mrvn>
both
<mrvn>
the CAMLparam() makes roots on the stack I believe.
<orbifx-m>
Finally are the roots moved too by the GC?
<mrvn>
the roots are C structures and immovable.
<mrvn>
(unless I'm mistaken)
<ggole>
All pointers are relocated by the GC
<ggole>
The objects themselves need not move (well, unless they're in the GCd heap)
<mrvn>
ggole: the roots aren't in the ocaml heap I believe
<ggole>
Right, but they need their values changed so that they point to the right places in the heap.
<mrvn>
sure. the contents, the pointers to the ocaml values they keep alive, changes.
<mrvn>
Or maybe not. They must have an extra indirection. the register_global_root() takes the address of a value outside the ocaml heap and keeps that updated. So root->static_value->ocaml_heap
<orbifx-m>
So if some value is registered as a global root, is it's position in memory fixed until unregistered?
<mrvn>
orbifx-m: yes. You register a value that's static or you allocated with malloc/new yourself. They never move.
<orbifx-m>
Can an ocaml value be registered?
<mrvn>
Same with CAMLparam(). They register stack positions and they never move too.
<mrvn>
orbifx-m: I think that would blow up as soon as the value gets moved.
agarwal1975 has quit [Quit: agarwal1975]
agarwal1975 has joined #ocaml
sh0t has joined #ocaml
<orbifx-m>
Aha, I think I got my bug. Is that because it causes some circle in what's supposed to be a directed graph?
<mrvn>
nah, circles are fine. The GC will see when it hits a block that's already marked.
<mrvn>
directed is just because A->B means A keeps B alive but B does not keep A alive.
<orbifx-m>
Previously I tried registering func at line 69, which you say it shouldn't work
<orbifx-m>
Now I'm thinking of making an array, store all the func-s there and register that for updatdes
regnat[m] has quit [Ping timeout: 244 seconds]
M-Illandan has quit [Ping timeout: 244 seconds]
Kakadu2[m] has quit [Ping timeout: 244 seconds]
<mrvn>
_dest doesn't seem to be a parameter,
barkmadley[m] has quit [Ping timeout: 260 seconds]
Kakadu2[m] has joined #ocaml
<mrvn>
extern "C" value Val_QVariant(value _dest, const QVariant& var) {
barkmadley[m] has joined #ocaml
srenatus[m] has quit [Ping timeout: 265 seconds]
Bluddy[m] has quit [Ping timeout: 244 seconds]
M-jimt has quit [Ping timeout: 255 seconds]
<mrvn>
why have _dest there at all?
Bluddy[m] has joined #ocaml
M-martinklepsch has quit [Ping timeout: 276 seconds]
<mrvn>
ahh, wait. For the default case, right?
M-pesterhazy has quit [Ping timeout: 240 seconds]
<mrvn>
As for caml_create_QQmlPropertyMap didn't I tell you how to fix that before?
<orbifx-m>
Not my code I need to re-read that segment.
<mrvn>
Line 81 messes with the GC state while the GC is running in another thread. *BOOM*
<orbifx-m>
You may have, but I didn't have the time then, and the developer has changed it a bit since
<mrvn>
nah, that code is still as brocken as back then.
<mrvn>
Maybe the same bad pattern appears often in the qt bindings.
<orbifx-m>
So I'm thinking of changing as I said above. An array of funcs, registered,
<orbifx-m>
And the closure using this static array
<mrvn>
that array will be too big or too small all the time.
agarwal1975 has quit [Quit: agarwal1975]
srenatus[m] has joined #ocaml
regnat[m] has joined #ocaml
M-Illandan has joined #ocaml
<orbifx-m>
Sounds like you have a better proposal?
M-jimt has joined #ocaml
<mrvn>
1) malloc/new a value, store _func in it and register it as root.
M-martinklepsch has joined #ocaml
<mrvn>
2) Make your _ans block bigger to store a pointer to the value in there too.
M-pesterhazy has joined #ocaml
<mrvn>
3) make _ans a custom block with finalizer so you can free the CamlPropertyMap and unregister the root.
<mrvn>
4) in the connect you need 2 lambdas. The first needs to leave the blocking section and call the second. The second needs CAMLparam(), CAMLlocal.
<orbifx-m>
These are steps, not alternatives?
<mrvn>
You can probably make that first lambda a generic "call_with_runtime_lock()" function that can be used in other places too.
<mrvn>
orbifx-m: steps
<orbifx-m>
I had implemented the two lambdas, but they got reduced to a single again.
<orbifx-m>
mrvn: do you have time to do a PR on these steps? If not it's ok I'll do it, but it might save the back and forth.
<mrvn>
Not at the moment, shoulöd be working.
<orbifx-m>
Ok, no probs. So I need those 4 steps?
<mrvn>
yep
FreeBirdLjj has quit [Remote host closed the connection]
<orbifx-m>
I understand most of what you prescribed, except: why does that second lamba need param and local?
<orbifx-m>
And 2, why does _ans need a pointer to the value too?
<mrvn>
orbifx-m: for the string you copy.
<mrvn>
orbifx-m: for unregister_global_root
<mrvn>
orbifx-m: you might want to add a 3rd field and store the return value of the connect there.
<mrvn>
orbifx-m: usefull for diconnect()
thizanne has joined #ocaml
<orbifx-m>
Ah ok yeah, I see you mean param0, local2(name..)
<orbifx-m>
I thought you meant something additional
<mrvn>
DOes meaty have userspace?
<mrvn>
ups
<mrvn>
orbifx-m: yes, the stuff you already have.
<mrvn>
basically just pull the caml_leave_blocking_section out of it into an outer lambda.
<orbifx-m>
Yeah, as it was before if I remember correctly
<mrvn>
Maybe ocaml should have a macro that combines the CAMLparam*()/CAMLreturn*() with blocking section.
<orbifx-m>
why can't the copy string and callback be in the same scope as leave_blocking_section and enter_blocking_section?
<mrvn>
because then the CAMLreturn0() would have to be before enter_blocking_section
<orbifx-m>
What's happening behind the since there?
g4143 has joined #ocaml
<mrvn>
CAMLparam() creates a GC root, CAMLreturn frees the root and returns. Since that messes with the GC state you need the runtime lock there.
<orbifx-m>
Yeah, i see.
yomimono has joined #ocaml
<Algebr`>
mrvn: can you do a blog post about all your knowledge with the this C binding level, you know so much about it
johnelse has quit [Ping timeout: 260 seconds]
<orbifx-m>
I second that. I started reading the interface manual again and my next step was to read the paper on GC, with the intention of writing a blog post
<Algebr`>
and more posts about this sensitive part of OCaml are very much needed, appreciated
<def`>
yep
yomimono_ has joined #ocaml
agarwal1975 has joined #ocaml
yomimono has quit [Ping timeout: 265 seconds]
<orbifx-m>
I will report on my findings in the end.
<orbifx-m>
But I'm long way from that.
Mercuria1Alchemi has quit [Ping timeout: 265 seconds]
<mrvn>
Algebr`: I would love a post explaining the inner workings of the interface between GC and threads. I tried understanding this from source for my own thread implementation but it keeps crashing after a while.
al-damiri has quit [Quit: Connection closed for inactivity]
<Algebr`>
please do
<mrvn>
can't write one myself since I don't know where I go wrong.
<orbifx-m>
mrvn: is 'value' just a pointer?
<mrvn>
orbifx-m: or int or char or () or []
<mrvn>
or Foo
rks| is now known as rks`
<def`>
orbifx-m: value is a word (32-bit or 64-bit depending on architecture)
<Algebr`>
maybe write/post what you have, then someone else can step up and correct it, we all benefit
<def`>
yes that's probably the best
<mrvn>
It's a word with tag containing a pointer or non-pointer value in the remaining bits.
<orbifx-m>
Yeah I mean the C type, is just an intnat
<orbifx-m>
The callback works until it's garbage collected.
<orbifx-m>
Do you see anything?
<Algebr`>
ha, lambdas also need this blocking wrapping
<mrvn>
propMap->saveCallback(*fv);
<mrvn>
*fv gets moved by the GC. you need to store fv
<orbifx-m>
thanks mrvn, this would take me hours. (got a deadline for this project... i think...)
<mrvn>
the stored value isn't used here though. must be crashing somewhere else
shinnya has joined #ocaml
johnelse_ has joined #ocaml
<orbifx-m>
Might be CamlPropertyMap which I've not got my head around yet
<mrvn>
Maybe change propMap->saveCallback() to register it as root and use that in the lambda?
<mrvn>
propMap->getCallback() or something
<mrvn>
but you probably don't want to change too much
<orbifx-m>
I'll try that for now, but generally I'm against adding new objects and classes, but it will be good for isolating the problem just now
johnelse has quit [Ping timeout: 255 seconds]
<mrvn>
Try: propMap->saveCallback(fv) and you should get a type error because value has become value*.
<mrvn>
then you know where to fix it.
<mrvn>
*wave*
copy` has joined #ocaml
<orbifx-m>
I know where it is, I'll change it's methods. So it should be taking the pointer instead of the value?
<orbifx-m>
What happens if you register a value twice?
<orbifx-m>
I just noticed in his stubs, it registers it again (in saveCallback)
g4143 has joined #ocaml
g4143 has quit [Client Quit]
<orbifx-m>
mrvn seems to survive GCs now after passing address instead of value to the saveCallBack
bruce_r has joined #ocaml
jbrown has quit [Ping timeout: 240 seconds]
yegods has joined #ocaml
<freehck>
btw people, is there a way to extend structure with new fields except using oop?
<freehck>
I remember there's such a cool stuff in Racket Scheme, so maybe there's some similar mechanism in ocaml?
SilverKey has joined #ocaml
<ggole>
First class modules, sort of
<freehck>
so only for modules, got you, thx
<orbifx-m>
Thanks for all the help mrvn
Algebr` has quit [Ping timeout: 240 seconds]
CubicE has joined #ocaml
bruce_r has quit [Ping timeout: 258 seconds]
<CubicE>
hey, I'm just starting out learning OCaml and I was wondering if there was something like -Wall for ocamlc?
<CubicE>
it has happened to me multiple times now that I've forgotten to supply some arguments to a function, so I've just had a function expression lying around somewhere not actually doing anything, like print_newline instead of print_newline ()
<zozozo>
CubicE: ocamlc -w +A
<CubicE>
hm, thanks but that still doesn't seem to warn about the situation I was talking about... is this some useful feature of the language I'm just not getting?
<ggole>
Well, print_newline is a valid OCaml value.
<def`>
(it is not a good idea though, some warnings are not useful for "everyday" code, or might change in the future)
<freehck>
CubicE: the situation you was talking about cannot be warned because partial apply is the normal thing in OCaml.
<zozozo>
CubicE: if you do "print_newline; ..." it should give you a warning
<CubicE>
I know that partial apply is normal, I'm just wondering why it's a valid top level expression
<zozozo>
however, if you do "let _ = print_newline in ..." there will be no warning
<CubicE>
that's not just for functions - i.e., why is "hello" a valid top level expression?
<freehck>
CubicE: try this: let p = print_endline; p "hello world\n";;
<def`>
replace ; by in though :)
<def`>
or by ;
<def`>
;;
<def`>
arg
<freehck>
yes, yes. s/;/in/; :)
<ggole>
You want to allow people to type any expression into the top-level, and also to not have different languages in the top-level and in files.
<freehck>
CubicE: If it seems for you to be wrong top-level expression, type in utop (opam install utop) something like "List.map;;" and see the result.
<CubicE>
utop? what?
<freehck>
utop is a repl for ocaml.
<CubicE>
and what's opam? The only thing I have is something called findlib
<freehck>
opam is a package manager for ocaml.
<freehck>
CubicE: I suppose you distro has it's package. You can easily install it via something like "apt-get/yum install opam"
<freehck>
s/it's/this/
<CubicE>
nope, I'm using msys2 and it only has ocaml, ocaml-camlp4 and ocaml-findlib for ocaml packages
<CubicE>
I don't even really want to install that, freehck just told me to without any explanation as to why
<zozozo>
well, opam helps a lot when you want to actually do anything interesting with ocaml, since it lets you install a lot of ocaml packages, and it also deals with multiple versions of the compiler being installed
<freehck>
CubicE: you don't really need to have utop as a repl. You can use the default on if you want.
<freehck>
But using opam is strongly recommended.
<yomimono_>
you can build utop without opam if you really want to, but opam will make it much easier to get the dependencies you need. if you intend to work with anyone else's software in the ocaml community you'll have a much easier time if you use it
<CubicE>
I don't want to do anything interesting with ocaml right now, I'm just trying to learn the language
<freehck>
CubicE: well, have you installed merlin editor at least?
<yomimono_>
if you're not interested in a nicer toplevel, you can get by without utop too :)
<CubicE>
why at least? I'm fine with emacs.
johnelse has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
<freehck>
CubicE: Emacs is a good choice when you use it with merlin-mode enabled. ;)
<CubicE>
or is this such a funky language that you can't expect to write code with a normal text editor anymore?
<freehck>
lol
<ggole>
emacs is a normal text editor now? :)
<yomimono_>
CubicE: I wrote OCaml professionally for ~1 year without merlin, but I'll admit I was happier once I got it working with vim :P
<chelfi>
CubicE: if you type any expression at your REPL's toplevel, you will get some pretty printing (in particular you can get the type of any function you input), which is one reason why it is useful to enable arbitrary toplevel values
<freehck>
ggole: Emacs is a normal OS! :P
<ggole>
CubicE: you can run the standard toplevel under emacs just fine
govg has joined #ocaml
<ggole>
utop provides a few amenities, that's all
<CubicE>
chelfi, well yes it's useful in a REPL. Not so useful in a normal module
<chelfi>
CubicE: and merlin is a tool that adds ocaml specific IDE features to many general purpose text editors (including emacs)
<CubicE>
that makes sense, but I find systems like that tend to be more of a hassle than anything else if I'm just trying to start out and write some code
johnelse_ has quit [Ping timeout: 276 seconds]
<chelfi>
it is of course optional, but so good that it is recommended for most setups
<freehck>
CubicE: msys2 is something like linux environment for windows?
<chelfi>
and regarding modules: not sure that is the main reason but I know that most beginners find confusing code that works in the REPL but not in a file, or conversely
<CubicE>
freehck, not quite, but close enough
<chelfi>
maybe not most, but at least several
<chelfi>
I mean, if you cannot paste code from the REPL to a file, or from a file to a REPL, tutorials become a lot more confusing
* freehck
glad to hear that somebody uses ocaml under windows. I'm stuck with ocaml 4.01.0 but there's CubicE who is in worse situation than me. :)
ggole_ has joined #ocaml
<chelfi>
one way to catch the previous error would be, as pointed out earlier, to always wrap your effects either in a "let () = myeffect" or to chain them explicitely with ';' so that you get an error or at least a warning when you only partially apply your function
<chelfi>
another would be to always annotate toplevel expressions with their type, so that the compiler/REPL can warn you when the type is different than the one you expect
<freehck>
chelfi: plus the repl will always type an expression type after its evaluation, and one can just check it with eyes.
ggole has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
yomimono_ has quit [Ping timeout: 252 seconds]
<chelfi>
indeed
jbrown has joined #ocaml
Algebr` has joined #ocaml
Anarchos has joined #ocaml
laserpants has joined #ocaml
AlexRussia has joined #ocaml
sh0t has quit [Ping timeout: 244 seconds]
<freehck>
People, I found really interesting chapter here: (see first-class fields)
<freehck>
I have tried it with my repl and got a syntax error.
<ggole_>
This is a camlp4 extension
<freehck>
Aaaaah...
<freehck>
So I need 4.03.0?
<ggole_>
The RWO intro describes how to set things up so that you get all that stuff
<freehck>
4.02.0
<ggole_>
No, camlp4 is a preprocessor
<ggole_>
Essentially for adding macros (like that one)
jwatzman|work has quit [Quit: jwatzman|work]
<freehck>
ggole_: but it was introduced in 4.02.0, isn't it?
<freehck>
Or I can use it with 4.01.0?
<ggole_>
No, it's been around forever. You can use it with 4.01.0.
<freehck>
Wow. thx.
<ggole_>
You might need to install some stuff, I forget the details.
g4143 has joined #ocaml
cdidd has quit [Ping timeout: 252 seconds]
octachron has quit [Quit: Page closed]
sepp2k has quit [Quit: Leaving.]
<freehck>
ggole_: what is your opinion about debugging camlp4 macros?
cdidd has joined #ocaml
g4143 has quit [Quit: Leaving]
<ggole_>
I've never had to do it, I avoid camlp4
<freehck>
ggole_: why do you prefer to avoid them?
jbrown has quit [Ping timeout: 276 seconds]
<ggole_>
They're pretty painful.
<freehck>
I mean I can understand why people avoid macros in f.e. C/Cxx, but I really love macros in Lisp/Scheme...
<freehck>
So I'd just like to know what is the situation with macros in OCaml.
jbrown has joined #ocaml
<ggole_>
Well, camlp4 is a very powerful and complicated system. It's not like defmacro in CL.
g4143 has joined #ocaml
d0nn1e has quit [Ping timeout: 244 seconds]
<freehck>
Good. Thanks.
<ggole_>
It's not as convenient either, since OCaml doesn't have Lisp's approach to staging.
<ggole_>
And finally, I've had my macro phase in Lisp, and now I prefer to write straight code wherever that is reasonable (which it usually is).
g4143 has quit [Client Quit]
zpe has quit [Remote host closed the connection]
sepp2k has joined #ocaml
yomimono_ has joined #ocaml
d0nn1e has joined #ocaml
<freehck>
ggole_: imho the real need of macros is quite a rare thing. The only case the macro can be a sane thing is if you get more than 10 times of source code lines reducing.
orbifx-m2 has joined #ocaml
orbifx-m has quit [Ping timeout: 276 seconds]
<CubicE>
Ok, OCaml has been pretty easy so far, but I swear I've been writing C code with ocaml syntax
orbifx-m has joined #ocaml
orbifx-m has quit [Client Quit]
g4143 has joined #ocaml
vbmithr has quit [Read error: Connection reset by peer]
<zozozo>
how so ?
<ggole_>
CubicE: for, ref and mutation?
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<freehck>
CubicE: examples! examples!
<freehck>
examples into studio!
vbmithr has joined #ocaml
<CubicE>
No, I think it's just because all the exercises I've done like "write cat in OCaml" pretty much lead me to writing Ccode
orbifx-m2 has quit [Ping timeout: 240 seconds]
<ggole_>
I see. Well, cat is just slinging bytes around.
<ggole_>
So that's a somewhat natural outcome.
<ggole_>
Maybe do 99 problems or something instead.
<freehck>
CubicE: try to achieve the same performance like the original cat. It's not an easy task. ;)
<CubicE>
I'm sure it's not, but what's the point?
<CubicE>
I don't feel like spending time on the intricacies of optimization when all I've written are 10 line programs is a particularly worthwhile effort
<CubicE>
I doubt becoming an expert at OCaml file I/O is something I want to be doing at this point
Simn has quit [Ping timeout: 260 seconds]
<freehck>
CubicE: okay, there're some things about Unix module and syscalls that are quite interesting in my opinion, but meybe not in your one.
laserpants has quit [Quit: Leaving]
tane has joined #ocaml
<Algebr`>
CubicE: the point to the become more familiar with the language
<Algebr`>
is to*
jeffmo has joined #ocaml
FreeBirdLjj has joined #ocaml
<CubicE>
well yeah, but if I'm going for "efficiency" the best way seems to be to circumvent the language entirely, not to work with it
<Algebr`>
CubicE: what would you like to do instead?
g4143 has quit [Quit: Leaving]
<CubicE>
I'd like to find out about the interesting parts of the language. Efficient file i/o pretty much works the same everywhere.
<Algebr`>
the interesting parts are the module system, object system, type system
<Algebr`>
imo
<freehck>
CubicE: you can learn how we construct new types.
<freehck>
records, type constructors and so on.
mfp has quit [Ping timeout: 252 seconds]
AltGr has left #ocaml [#ocaml]
malc_ has joined #ocaml
jbrown has quit [Ping timeout: 276 seconds]
g4143 has joined #ocaml
g4143 has quit [Client Quit]
Denommus has joined #ocaml
sh0t has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
Simn has joined #ocaml
jwatzman|work has joined #ocaml
yomimono_ has quit [Quit: Leaving]
g4143 has joined #ocaml
f[x] has joined #ocaml
g4143 has quit [Client Quit]
thizanne has quit [Ping timeout: 260 seconds]
yegods has quit [Remote host closed the connection]
SilverKey has quit [Read error: Connection reset by peer]
<Bluddy[m]>
CubicE: to get why functional programming is safer, you want to force yourself to use functional (persistent) data structures like List and Map, and you want to make use of algebraic data types. I recommend choosing a simple game (like checkers or chess) and implementing it with a very basic terminal interface (no AI, or random AI). Avoid using hashtables or arrays, as they have an imperative interface, and should only be
<Bluddy[m]>
used in isolated instances when you need extra performance anyway (from a functional programming perspective). Don't use any library except for the standard library and/or Batteries.
<CubicE>
I don't have a problem with functional programming, I've been using Haskell on and off for the last couple of years. I'm mostly really looking into the stuff that's specific to OCaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
<ggole_>
Polymorphic variants and modules, then
FreeBirdLjj has joined #ocaml
Algebr` has joined #ocaml
jbrown has joined #ocaml
johnelse_ has joined #ocaml
hannes` has joined #ocaml
malc_` has joined #ocaml
M-ErkkiSeppl has quit [Ping timeout: 264 seconds]
M-ErkkiSeppl has joined #ocaml
malc_ has quit [Ping timeout: 264 seconds]
johnelse has quit [Ping timeout: 264 seconds]
M-Illandan has quit [Ping timeout: 264 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
tg has quit [Ping timeout: 264 seconds]
ahf has quit [Ping timeout: 264 seconds]
companion_cube has quit [Ping timeout: 264 seconds]
maurer has quit [Ping timeout: 264 seconds]
tobast has quit [Ping timeout: 264 seconds]
adrien has quit [Ping timeout: 264 seconds]
rixed has quit [Ping timeout: 264 seconds]
<fds>
chsn: IIRC, each chapter says at the start which is the corresponding checker.
jtmcf has quit [Ping timeout: 264 seconds]
nopf has quit [Ping timeout: 264 seconds]
Enjolras_ has quit [Ping timeout: 264 seconds]
hannes has quit [Ping timeout: 264 seconds]
zapu has quit [Ping timeout: 264 seconds]
<fds>
There's a footnote on teh first page.
adrien has joined #ocaml
companion_cube has joined #ocaml
jtmcf has joined #ocaml
ggole_ has quit []
tg has joined #ocaml
srenatus[m] has quit [Ping timeout: 276 seconds]
ahf has joined #ocaml
M-Illandan has joined #ocaml
Enjolras has joined #ocaml
rixed has joined #ocaml
MercurialAlchemi has joined #ocaml
nopf has joined #ocaml
srenatus[m] has joined #ocaml
tobast has joined #ocaml
zapu has joined #ocaml
maurer has joined #ocaml
thizanne has joined #ocaml
<Bluddy[m]>
CubicE, ggole_: specifically, functors (the OCaml kind). Practice creating functorized code. In general, if you know haskell, you know 90% of OCaml, except you can use state (and therefore better data structures) much more easily. You'll miss typeclasses.
<Bluddy[m]>
CubicE: It's also worth playing a little with objects to see how, in small doses, they can do things that are very complex in haskell.
zpe has joined #ocaml
Denommus has quit [Remote host closed the connection]
sh0t has joined #ocaml
yegods has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
jbrown has quit [Ping timeout: 255 seconds]
jeffmo has quit [Quit: jeffmo]
ciniglio1 has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
tmtwd has joined #ocaml
jwatzman2 has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
jwatzman|work has quit [Ping timeout: 258 seconds]
slash^ has quit [Quit: Leaving]
kakadu has joined #ocaml
yegods has joined #ocaml
jeffmo has joined #ocaml
jwatzman|work has joined #ocaml
jbrown has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
jwatzman2 has quit [Ping timeout: 250 seconds]
rgrinberg1 has quit [Ping timeout: 252 seconds]
jbrown has quit [Ping timeout: 240 seconds]
jbrown has joined #ocaml
tobiasBora has joined #ocaml
malc_` has left #ocaml ["ERC (IRC client for Emacs 25.0.50.2)"]
rgrinberg has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
jwatzman|work has joined #ocaml
SpaceSheep has quit [Quit: WeeChat 1.5]
SpaceSheep has joined #ocaml
zpe has quit [Remote host closed the connection]
adelbertc has joined #ocaml
al-damiri has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
bruce_r has joined #ocaml
thegameg has quit [Remote host closed the connection]
thegameg has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
<tizoc>
mm.. what changed for ppx from 4.02 to 4.03 ? I'm getting this error when compiling some code
<tizoc>
Error: This expression has type Parsetree.constructor_arguments but an expression was expected of type Parsetree.core_type list
chsn has left #ocaml [#ocaml]
FreeBirdLjj has quit [Remote host closed the connection]
agarwal1975 has quit [Quit: agarwal1975]
SpaceSheep has quit [Ping timeout: 258 seconds]
rgrinberg has quit [Ping timeout: 265 seconds]
tane has quit [Quit: Leaving]
<tizoc>
ok I figured it out (this is related to the new inline records)
Simn has quit [Read error: Connection reset by peer]
LiamGoodacre has quit [Quit: Leaving]
jeffmo has quit [Ping timeout: 276 seconds]
banjiewen has joined #ocaml
FreeBirdLjj has joined #ocaml
kakadu has quit [Remote host closed the connection]
digiorgi has joined #ocaml
rgrinberg has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
thizanne has quit [Ping timeout: 255 seconds]
manizzle has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
bruce_r has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
<digiorgi>
hi, is normal that merlin tries to autocomplete anything in variables... for example let x = "adas" in x. ... and in that x tries to complete for example the Module Core? or fields of records??
yegods_ has joined #ocaml
yegods has quit [Read error: Connection reset by peer]