<Tekk_>
and then be able to do like Entity.texture player_instance and have it go to Player.texture player_instnace
<Tekk_>
instance*
<Tekk_>
I could definitely do it with objects but this seemed more interesting
<Drup>
just do Player.texture instead
<Tekk_>
yeah
<Tekk_>
that works for now
<Drup>
Entity is a type, not a module, call the module instead
<Drup>
(well, a module type)
<Tekk_>
mhm
<Tekk_>
but what when I have more entity types than player?
<Tekk_>
in the case of the list at least
<Tekk_>
I can probably assume that callers know the module of the type they want :P
<Tekk_>
basically how do I express the last line in a way that works.
<Drup>
I see
<Tekk_>
I suppose that I could construct a polymorphic variant for it..
<Tekk_>
right?
<Tekk_>
and that'd preseve extensibility
<Drup>
so, there are several possibilities, but in your place, I would just do a sum type. Maybe an open type if you want the extensibility
<Drup>
you can also do an object, ofc. Since you want inheritance, it's a sane choice.
<Tekk_>
mhm
bytbox has joined #ocaml
<Drup>
but with object, you will have no upcasting.
<Drup>
only downcasting
<Tekk_>
this isn't permanent code, it'll be replaced once I figure out what I want later, so a sum type probably works
<Tekk_>
Drup: I think that #type would be sufficient in that case wouldn't it?
<Tekk_>
(half-remembering the syntax there, whatever "anything that is a superset of this object's methods" is)
<Drup>
sort of, but that's not my point
bytbox has quit [Remote host closed the connection]
<Drup>
no upcasting means that you can't figure out if the entity you just get from a list is a player or something else
<Tekk_>
hm
<Tekk_>
yeah, that would throw events off a bit :p
<Tekk_>
thanks Drup
<Drup>
Tekk_: did you read the blog posts about doing an entity system in ocaml ?
<Drup>
well, it's about a game engine in general, in fact
chinglish has joined #ocaml
<Tekk_>
Drup: yep
<Tekk_>
talked to the guy too :)
<Tekk_>
the one at cranial burnout?
<Drup>
yes
BitPuffin has joined #ocaml
<Tekk_>
yeah
<Tekk_>
we've talked for a bit, that's the direction I'm going in eventually
<Tekk_>
but this is just a small thing to test out my bindings atm
IbnFirnas has joined #ocaml
q66 has quit [Quit: Leaving]
psy_ has quit [Quit: Leaving]
darkf has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
eyyub has quit [Ping timeout: 276 seconds]
rgrinberg has joined #ocaml
laalko has joined #ocaml
<laalko>
What's the preferred lib for fetching a file over http?
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<uucico>
is there a way to get the current stack trace programmatically? try raise x with x -> Printexc.get_backtrace () is almost what i want, except that it doesn't trace up to the top of the stack..
kapil__ has joined #ocaml
<Drup>
laalko: cohttp or ocurl, I would guess
yminsky has joined #ocaml
<whitequark>
uucico: Printexc.get_callstack
<laalko>
... thanks Ubuntu for having three different libcurls...
<uucico>
whitequark: thanks! should have read the whole Printexc module description..
jao has quit [Ping timeout: 245 seconds]
manizzle has quit [Ping timeout: 245 seconds]
ygrek_ has joined #ocaml
chouser has joined #ocaml
BitPuffin has quit [Ping timeout: 276 seconds]
rossberg has quit [Ping timeout: 245 seconds]
fraggle-boate has quit [Read error: No route to host]
yminsky has quit [Quit: yminsky]
uucico has quit [Ping timeout: 246 seconds]
rossberg has joined #ocaml
swgillespie has joined #ocaml
osa1 has quit [Ping timeout: 272 seconds]
destrius has joined #ocaml
yminsky has joined #ocaml
fraggle-boate has joined #ocaml
siddharthv_away is now known as siddharthv
IbnFirnas has quit [Read error: Connection reset by peer]
lordkryss has quit [Quit: Connection closed for inactivity]
osa1 has joined #ocaml
pyon is now known as pyon-k
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
rgrinberg has quit [Quit: Leaving.]
psy_ has joined #ocaml
rgrinberg has joined #ocaml
yminsky has quit [Quit: yminsky]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
AlexRussia has quit [Ping timeout: 245 seconds]
AlexRussia has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
IbnFirnas has joined #ocaml
erider has joined #ocaml
erider has quit [Ping timeout: 245 seconds]
ivan\ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
badkins has quit []
enitiz has quit [Ping timeout: 256 seconds]
reem has quit [Remote host closed the connection]
sivoais has quit [Ping timeout: 264 seconds]
moei has quit [Read error: Connection reset by peer]
sivoais has joined #ocaml
moei has joined #ocaml
enitiz has joined #ocaml
lambdahands has quit [Quit: leaving]
hcarty has quit [Ping timeout: 264 seconds]
MrScout has joined #ocaml
hcarty has joined #ocaml
MrScout has quit [Read error: Connection reset by peer]
MrScout has joined #ocaml
kapil__ has quit [Quit: Connection closed for inactivity]
chouser has quit [Ping timeout: 245 seconds]
enitiz has quit [Ping timeout: 276 seconds]
reem has joined #ocaml
igitoor has quit [Ping timeout: 276 seconds]
igitoor has joined #ocaml
igitoor has joined #ocaml
igitoor has quit [Changing host]
kapil__ has joined #ocaml
laalko has quit [Quit: Leaving]
ygrek_ has quit [Ping timeout: 256 seconds]
MrScout has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
MrScout_ has joined #ocaml
MrScout_ has quit [Ping timeout: 252 seconds]
IbnFirnas has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 264 seconds]
contempt has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
contempt has joined #ocaml
IbnFirnas has joined #ocaml
osa1 has joined #ocaml
MrScout_ has joined #ocaml
willy__ has joined #ocaml
MrScout_ has quit [Ping timeout: 256 seconds]
willy_ has quit [Ping timeout: 264 seconds]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
Submarine has quit [Remote host closed the connection]
osa1 has quit [Ping timeout: 265 seconds]
larhat has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
MercurialAlchemi has joined #ocaml
Kakadu has joined #ocaml
yaewa has joined #ocaml
moei has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 246 seconds]
larhat has quit [Quit: Leaving.]
IbnFirnas has quit [Ping timeout: 244 seconds]
nopf has joined #ocaml
ggole has joined #ocaml
alkoma has joined #ocaml
Haudegen has joined #ocaml
regnat has quit [Ping timeout: 265 seconds]
regnat has joined #ocaml
ygrek_ has joined #ocaml
endiruna has joined #ocaml
hekmek has joined #ocaml
hekmek has quit [Read error: Connection reset by peer]
matason has joined #ocaml
waneck has quit [Ping timeout: 245 seconds]
IbnFirnas has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has quit [Quit: Leaving.]
fraggle-boate has quit [Ping timeout: 264 seconds]
psy_ has quit [Quit: Leaving]
rgrinberg has joined #ocaml
dsheets has joined #ocaml
fraggle-boate has joined #ocaml
alkoma has quit [Ping timeout: 255 seconds]
maufred has quit [Remote host closed the connection]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
lordkryss has joined #ocaml
Simn has joined #ocaml
ggole has quit [Ping timeout: 264 seconds]
maufred has joined #ocaml
endiruna has quit [Ping timeout: 265 seconds]
jneen is now known as jneen|zzz
blech___ has joined #ocaml
blech__ has quit [Ping timeout: 245 seconds]
ollehar has joined #ocaml
larhat has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
skinkitten has joined #ocaml
ingsoc has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
<MercurialAlchemi>
companion_cube: I'm looking at the lwt actor module in containers
keen__________45 has joined #ocaml
<MercurialAlchemi>
it looks intriguing
<MercurialAlchemi>
are you planning on doing more with it?
<MercurialAlchemi>
(though IMHO it would be better as a standalone lib in this case)
keen__________44 has quit [Ping timeout: 264 seconds]
rock_neurotiko has joined #ocaml
rock_neurotiko has quit [Read error: Connection reset by peer]
<companion_cube>
MercurialAlchemi: well it's quite experimental atm
<companion_cube>
if you have suggestions I'd be glad to hear them ;)
<MercurialAlchemi>
I'll have to try out it if I get to do something distributed, I'll let you know :)
<MercurialAlchemi>
also, I was wondering how much CCLinq is relevant considering the existence of sequence
<companion_cube>
it has some convenient things when you're doing joins or similar things, but yeah, Sequence is fine most of the time
jonludlam has joined #ocaml
psy_ has joined #ocaml
_andre has joined #ocaml
whitequark has quit [Ping timeout: 272 seconds]
whitequark has joined #ocaml
bytbox has joined #ocaml
mehdi__ has quit [Remote host closed the connection]
yomimono has joined #ocaml
mehdi_ has joined #ocaml
<ingsoc>
I now have ocamlbuild working and I can generate .native and .byte, I am a little surprised at the size of the generated files though
mort___ has joined #ocaml
<ingsoc>
byte code is 58mb for a hello world program, this is when using Core.Std
<rks`_>
ingsoc: are you using core?
<ingsoc>
yeah
<rks`_>
yes
<MercurialAlchemi>
ingsoc: oh, core
<rks`_>
well, it's a sad thing
<MercurialAlchemi>
it's not a bug, it's a feature
<ingsoc>
:)
<rks`_>
but that should change in a release or two
<ingsoc>
ok
<ingsoc>
the native is around 8mb
<ingsoc>
which is fine
<rks`_>
(it's a side effect of using "packed modules")
<ingsoc>
is there any reason to0 go byte code ?
<MercurialAlchemi>
ocamldebug
<rks`_>
(but they should get rid of that in a release or two)
<MercurialAlchemi>
also, compilation is faster
<ingsoc>
is this just if you have a platform you can't compile to native on but have a an ocaml VM
<companion_cube>
or js_of_ocaml
<ingsoc>
ocamldebug ok so if you need to do some real debugging (as in step debugging ?) I would need to compile to .byte and use ocamldebug
<ingsoc>
?
<whitequark>
backtraces are generally more precise in bytecode
<rks`_>
ingsoc: or you could compile to native code and use gdb
<ingsoc>
tbh I have hnot had a fun time with getting up and running with ocaml, it is not the language per se but the hassle with all the tooling the concepts and multitude of different file extensions .ml, .mli, cmo cmi etc
<rks`_>
(but there's no dwarf generation, once again that will probably come in a release or two)
<ingsoc>
do people drive things like ocamlbuild with a makefile ?
<companion_cube>
yep, a target all: ocamlbuild -use-ocamlfind -package foo bar.native
<ingsoc>
i mean is it common to have a makefile to drive the different ocaml tooling
<whitequark>
rks`_: there is dwarf generation
<companion_cube>
I think it's common
<whitequark>
only for line numbers and such though
<whitequark>
and no, it will not be easily improved
<MercurialAlchemi>
ingsoc: I'd say so
<whitequark>
nor there are plans to do so
<rks`_>
whitequark: well, mark shinwell is working on proper dwarf generation
<rks`_>
and the results are impressive
<whitequark>
oh? okay, great then
jgjl has joined #ocaml
<MercurialAlchemi>
(especially considering how many OCaml developers seem to be on Windows systems...)
<whitequark>
I don't understand how is he going to teach gdb the ocaml object model
<ingsoc>
well anyway, thankfully I am getting somewhere now and can move on from just typing one liners in the utop
<rks`_>
haha
<whitequark>
and how to tell it about ocaml types
<rks`_>
well, it reads cmts
IbnFirnas has joined #ocaml
<ingsoc>
the ide i am using does not seem to be opam friendly either and doesn't seem to use ocamlfind to resolve stuff
<MercurialAlchemi>
ingsoc: you can always load your .mls in utop, you know :)
<ingsoc>
I understand ocaml community is not large like java/c#/python etc. so I kinda expected a few sticking points
willy__ has quit [Read error: Connection reset by peer]
Cypi has quit []
<MercurialAlchemi>
we have a large choice of sharpened sticks for your pleasure
<ingsoc>
companion_cube: well i use eclipse for erlang and python and a few other things and I like the project management stuff and file search replace (etc. etc.) so i searched for a plugin, there was ODT and OcalIDE, the latter seemed to have been updated more recently. the thing is its configuration for the tools defaults to the system /usr/ not an opam installed one
<ingsoc>
luckily there was a mature plugin for erlang for eclipse but most erlangers use emacs/vim which i was hoping i could avoid learning as it is just another hindrence to getting productive
<ingsoc>
seems emacs/vim is the favourite here too
<whitequark>
rks`_: whoa, that looks really nice
<MercurialAlchemi>
well, I'm afraid most ocamler are emacs/vim people too
<rks`_>
ingsoc: I think someone was working on a modern eclipse binding
<MercurialAlchemi>
rks`_: so we'd get useful debugging info in gdb?
<MercurialAlchemi>
awesome
AlexRussia has joined #ocaml
<ingsoc>
MercurialAlchemi: oh I am not averse to learning new stuff ;), it is just that i have been in permanent learning mode over the last 2 years coming from an operations background intitally I have taught myself web dev erlang python and switched from windows to linux (cos of the tooling issue on windows) all in the last 2 years so kinda burnt out
<ingsoc>
:P
<rks`_>
MercurialAlchemi: yeah
<ingsoc>
i wanted a high performance counterpart to those other languages and well java just seemd verbose and after erlang I kinda liked the functional way of programming better than imperative
<ingsoc>
I also don't really care about .net anymore as I have swallowed the linux pill
<MercurialAlchemi>
Java doesn't just "seem" verbose :)
<MercurialAlchemi>
but I have to say that it's difficult to do Linux work while avoiding vim
<ingsoc>
well anyway my gut feeling is vim will be easier to get started (if i go down the vim or emacs route) but I want to make sure that vim and ocaml are definite bed fellows
<MercurialAlchemi>
you're eventually going to have to remote into a server where the only editor available will be vim
<rks`_>
ingsoc: they are
<MercurialAlchemi>
oh, they are
<companion_cube>
vim + ocaml + merlin = awesome
<ingsoc>
are they both equally supported by the community ?
<MercurialAlchemi>
it's like an IDE (well, mostly) without the hassle
<rks`_>
(you have screenshots on that page)
<MercurialAlchemi>
(and without the debugger)
<ingsoc>
well, judging from the fact any time i mention ocalide on here everyone says "ocalide who ?" i may have an easier time just learning vim and merlin etc. at least I can get help :)
<MercurialAlchemi>
(or project-wide renaming or function extraction, but that's not a big deal in fascist language like OCaml)
<ingsoc>
and this channel has been very tolerant and friendly to my noobness so thanks
<ingsoc>
:D
<rks`_>
MercurialAlchemi: project-wide renaming might come some day (with limitations)
<ingsoc>
does ocaml have any features to connect to a running vm
<ingsoc>
running code
<ingsoc>
on a live system
<ingsoc>
via utop or something like that ?
<ingsoc>
if anyone has used erlang before I am talking something like the erlang remote shell
<rks`_>
:')
<rks`_>
not that I know of
<ingsoc>
i think clojure now has tooling for this kind of feature now
<ingsoc>
I kinda messed around with that before coming to ocaml
<rks`_>
but then, there is no "running vm"
<ingsoc>
even in byte-code ?
<ingsoc>
ok
<ingsoc>
well i need to read more
<flux>
hmm.. I wonder if one could easilyish have a mirage xen host running only ocaml toplevel behind ssh :)
<companion_cube>
any way to change the default solver of opam?
<MercurialAlchemi>
change it how?
<companion_cube>
I have a solver which uses aspcud "in da cloud" (my distro doesn't provide it)
<companion_cube>
but it's getting tiresome to type --solver=cudf_remote_proxy
<flux>
shell alias?-)
<MercurialAlchemi>
exactly what I was going to say
<MercurialAlchemi>
you can also set OPAMEXTERNALSOLVER apprently
<MercurialAlchemi>
what distribution is it that doesn't have aspcud, out of curiosity?
<companion_cube>
fedora
<MercurialAlchemi>
(I should really send a feature suggestion to Microsoft: "please refuse to save any document called 'screenshot.docx' and direct the user to Paint instead")
<companion_cube>
:D
Haudegen has quit [Ping timeout: 264 seconds]
<def`>
rks`_: even without vm, if you have type info it's reasonably easy to plug into a running bytecode instance, and a bit more tricky but not impossible to connect to a native instance
<flux>
mercurialalchemi, sounds like a job for Clippy
<def`>
it's worth exploring what that would enable :)
<ingsoc>
I am using ubuntu
<ingsoc>
options for vim packages are...
<ingsoc>
* vim
<ingsoc>
* vim-gnome
<ingsoc>
* vim-tiny
<ingsoc>
* vim-athena
<ingsoc>
* vim-gtk
<ingsoc>
* vim-nox
Haudegen has joined #ocaml
<ingsoc>
is vim available as terminal and windowed
<MercurialAlchemi>
ingsoc: if you're comfortable with the terminal, vim-nox, otherwise vim-gnome
<MercurialAlchemi>
(also has the terminal version)
<MercurialAlchemi>
vim-nox is the terminal-only version
ivan\ has quit [Read error: Connection reset by peer]
<ingsoc>
MercurialAlchemi: I am comfortable with terminal but makes sense to just install both as disk space no worry
ivan\ has joined #ocaml
<ingsoc>
i mean
<ingsoc>
vim-gnome
<MercurialAlchemi>
sure
<MercurialAlchemi>
(I find gvim to be pretty crap and never use it)
<def`>
(+1)
<MercurialAlchemi>
on the other hand I work in a terminal all the time, except for FF/Skype and occasionally Dolphin
<MercurialAlchemi>
the vim mod of Kate is pretty neat, but that's not going to help with OCaml tooling
<ingsoc>
MercurialAlchemi: oldskooler showing your age maybe ?
<ingsoc>
:)
<MercurialAlchemi>
well...
<MercurialAlchemi>
I do have a beard
hellofunk has quit [Remote host closed the connection]
<ingsoc>
I'm growing one, I just got a long way to go until it is McCarthy/Ritchie style lol
<ingsoc>
OK, I am determined to put my IDE woes behind me today...
<MercurialAlchemi>
:)
rand000 has joined #ocaml
ygrek_ has quit [Ping timeout: 256 seconds]
rand000 has quit [Read error: Connection reset by peer]
rand000 has joined #ocaml
<rks`_>
def`: i'm not saying it's impossible
<rks`_>
it's just that at the moment, there's no easy way
<rks`_>
it erlang it's easy
<rks`_>
you just do
<rks`_>
$ erl -someflag my_targ
<rks`_>
and done.
<def`>
rks`_: yep, I was just considering the eventually of making such a tool :P
<def`>
(but I never used erlang… I should probably give it a try, this aspect looks well done, which is rare enough in this industry to spend some time on the matter :P)
<MercurialAlchemi>
Java has great tooling too
<ingsoc>
def`: the erlang runtime is awesome (hyperbole intended)
<ingsoc>
and you have to nuke it to make it die
<def`>
ingsoc: yep, I am especially interested by the monitoring aspect
<ingsoc>
and once you get your head around the concurrency it just makes alternatives look pathetic
<def`>
the same can be said of monadic concurrency library
<ingsoc>
ocaml the language itself looks to my albeit untrained more elegant and also I like the type inference static typing
<rks`_>
yeah ingsoc, erlang's model is nice, but you'll get used to lwt/async really quicly
<ingsoc>
(i like the idea of it as never seen it before)
<rks`_>
def`: ok :)
<ingsoc>
it is also obviously faster (hence my interest) as I just cannot cope with dealing with c/c++
<MercurialAlchemi>
rks`_: never used Erlang but I wouldn't say lwt has the same scope
<ollehar>
lwt/async is not parallel, though, right?
<rks`_>
it's not
<rks`_>
well
<rks`_>
:)
<MercurialAlchemi>
it's also not designed for multiple machines
<rks`_>
MercurialAlchemi: it's just that you're often fine with what lwt offers
<def`>
ollehar: it has no shared memory model, but the same apply to erlang
<MercurialAlchemi>
oh, I'm fine with what lwt offers :)
<ingsoc>
the error detection and recovery is superb and very different to anything else I have seen. I guess typical erlang has potentially more problems than a typical ocaml program (I have kinda found myself defining types using the erlang type preprocessor - dialyzer) but you can get away with poorer code in erlang due to supervision trees
<def`>
(and this is a limitation of ocaml runtime, nothing inherent to monadic concurrency, although cooperative threading makes things easier)
<MercurialAlchemi>
rks`_: I'd say that you could build something Erlang-like on top of lwt
<ingsoc>
I wouyld be glad to offer any help with erlang in exchange for some ocaml mentoring
<ingsoc>
:P
<ollehar>
also, documentation of lwt sucks
<MercurialAlchemi>
(well, for certain properties of erlang, you're not going to get soft real-time anytime soon)
<ingsoc>
docco seems to be proportional to the community size
<rks`_>
ingsoc: i'm sure people will be happy to help you with any problem you might have
<rks`_>
without requiring you to help them use erlang
<def`>
eingsoc: this is more of a problem in ocaml, lwt get it pretty bad in my experience, async with its monitors and some discipline is better, but it looks inferior to erlang
<ingsoc>
for my use case, I see erlang as the controlling concurrency hub and coordination language
<MercurialAlchemi>
rks`_: yes, "tell us why you want to use an IDE and we'll explain why you don't need it" kind of help :)
<def`>
ollehar: that's subjective, I found lwt doc much better than the average java doc (including std lib)
dario_ has joined #ocaml
<ingsoc>
which farms out requests to things like python (massive library scope) and hopefully ocaml (performance and robustness of code)
<def`>
(but the api and semantics suck, and show some "legacy")
<def`>
looks like a reasonable design (*troll* except for the python part)
<MercurialAlchemi>
ollehar: well, you should look at Python's Twisted doc :)
<ollehar>
def`: really? how hard is it to find a tutorial in java compared to lwt?
<def`>
I never talked about tutorial
<ollehar>
ocaml is saved by its great and active community, though. like irc and stackoverflow.
<ollehar>
def`: no, because you're not a noob like me
<def`>
I understood doc as reference, sorry
<def`>
of course, java has much more tutorials, can compete on that :)
<ollehar>
reference literature is not useful for learning.
<def`>
can't*
<def`>
but low quality tutorials makes you learn wrong things, which is better only on really short term
AltGr has left #ocaml [#ocaml]
<def`>
(there is so much things about java that's its hard to find what is good)
<rks`_>
MercurialAlchemi: :D
<rks`_>
ollehar: i'd consider RWO to be a really good tutorial
Simn has quit [Ping timeout: 276 seconds]
<rks`_>
(yes yes, I know, it's presenting async, not lwt)
<ingsoc>
so is lwt/async more like node/twisted programming ?
<ingsoc>
(callback based asyncio)
Simn has joined #ocaml
<dario_>
ingsoc: Lwt/Async does not rely on callbacks
<dario_>
It's similar to node/twisted only in the sense you can do async IO easily
<dario_>
However, the Lwt/Async model (based on monads) is much better
<ingsoc>
that was the await stuff that as added to later versions of .net/c#
lpw25 has joined #ocaml
<ingsoc>
so your code looks more sequential rather than callbacks all over the place
<rks`_>
looks like it yes
<rks`_>
(but I never used it, I just glanced at your link)
<dario_>
ingsoc: yes, when using Lwt/Async, the code looks very sequential
<ingsoc>
yeah i never used it as by the time that came out I had moved on
<rks`_>
ingsoc: if you're learning by reading RWO, you should continue
<rks`_>
there's a chapter dedicated to async
<ingsoc>
ok.
<dario_>
ingsoc: If you learn Async via RWO you can then easily learn LWT also
<dario_>
It seems LWT is more popular in the OCaml community...
<dario_>
...though Async is also a fine library.
AlexRussia has quit [Ping timeout: 265 seconds]
<dario_>
(It's mostly a matter of historical contingency which determines who uses which)
regnat has quit [Ping timeout: 265 seconds]
<ingsoc>
RWO seems to take a while to even begin talking about modules and compiling code and from what I can gather there is a fair bit more involved and a lot more options you have to actually run code compared to a lot of other environments
<ingsoc>
(with ocaml)
<dario_>
ingsoc: it depends
<ingsoc>
this has been a source of my initial confusion that along with setting up an IDE
<dario_>
If your program is simple, you can run it the same way you would run a shell script
<ingsoc>
my first program to test ocaml is one to connect to my erlang REST service and pull some data in JSON or msgpack and then log it to a text file as csv
<ingsoc>
jsut seems a reasonable test to get a feel for it
<ingsoc>
or write as an xml doc
<dario_>
Which libraries are you using?
<ingsoc>
so it is networking http serialisation lib support and some IO
<ingsoc>
no idea yet
<dario_>
For HTTP, you have OCamlnet, cohttp, Ocsigenserver...
<ingsoc>
just setting up vuim and merlin after abandoning ocalide (eclipse plugin)
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dario_>
I wouldn't worry too much with the IDE stuff right now...
<dario_>
Just fire up VIM and write your code...
<ingsoc>
I think cohttp was referenced in RWO as a lib to install
<ingsoc>
yeah
regnat has joined #ocaml
<dario_>
Cohttp is a good choice for HTTP
<dario_>
For JSON, there's Yojson
<dario_>
For CSV there's ocaml-csv
<dario_>
(all these libraries are available via OPAM)
<ingsoc>
dario_: thanks, I will report back
<dario_>
ingsoc: you're welcome. Good luck!
IbnFirnas has quit [Read error: Connection reset by peer]
<dario_>
ZMQ.Proxy does not play nicely with LWT's event loop, right?
jonludlam has quit [Ping timeout: 272 seconds]
Thooms has joined #ocaml
<dario_>
Moreover, doing it manually requires using ZMQ.Poll, which I presume also doesn't work well with LWT.
<dario_>
So, has anyone tried something similar with ZMQ and LWT?
jonludlam has joined #ocaml
<ollehar>
rks`_: yeah, RWO seems great.
<ollehar>
much needed book.
Denommus has quit [Ping timeout: 272 seconds]
IbnFirnas has joined #ocaml
<ingsoc>
rks`_:, MercurialAlchemi: OK, I have vim installed and merlin working (from what I can gather) and I have code completion. The problem is it doesn't seem to work in gvim, any ideas why this would be ? is it a case of the environment vars or something like that not known to the gui client ?
siddharthv is now known as siddharthv_away
siddharthv_away is now known as siddharthv
esden has quit [Remote host closed the connection]
<ingsoc>
also, is there a way to chage keybindings for things, lol, maybe i just need a vim cheat sheet
<ingsoc>
also workflow would be a 2 terminals open ?, one with the vim editor and another with utop running and them both having the working directory where my project files are ?
<ingsoc>
then having a makefile to drive ocamlbuild etc.
<ingsoc>
?
AlexRussia has quit [Ping timeout: 252 seconds]
<rks`_>
I have no idea why it wouldn't work in gvim
<ingsoc>
grrrr
<ingsoc>
: /
<rks`_>
oh
<rks`_>
I just tried and I have a lot of errors
<rks`_>
(pathing problem apparently)
<ingsoc>
yeah can't find a load of stuff
<rks`_>
yep, same problem here
<def`>
env var yes ?!
<rks`_>
(nevermind me, I had another problem)
<rks`_>
yep, no problem here sorry
Thooms has quit [Ping timeout: 240 seconds]
<ingsoc>
def`: what do you mean
<def`>
ingsoc: launch gvim from console
<MercurialAlchemi>
ingsoc: hmm
cdidd_ has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
<MercurialAlchemi>
when launching vim from the console in a directory with a .merlin, it seems to work
<ingsoc>
MercurialAlchemi: sorry i was launching from the gui (ALT+F2 ubuntu) I am guessing that the environment isn't set up the same ?
<rks`_>
yes
<MercurialAlchemi>
ingsoc: well, the process probably uses ~ as directory in this case
<rks`_>
(that's what def` meant by "env var")
<rks`_>
MercurialAlchemi: that shouldn't be a problem, merlin locates the .merlin file relative to the file you are editing
<rks`_>
I'm guessing the problem was: merlin wasn't in PATH
<ingsoc>
ok, i now have a dir with a .merlin, and a _tags file (for ocaml build0 and a Makefile driving the build of the top level module (entry point) and I am happy
<ingsoc>
thaks for all your help
<ingsoc>
now i just need to work out how to operate VIM
<ingsoc>
lol
<ingsoc>
Iwonder if there is an eclipse mode or i should just bite the bullet and learn the keybindings
<ingsoc>
it is a bit cryptic thp
<MercurialAlchemi>
well
cdidd has joined #ocaml
<rks`_>
ingsoc: you can edit the bindings, you could also use emacs if the feels more natural
<ingsoc>
never used emacs in my life so maybe i would be in same position
<rks`_>
as for an emacs plugin, as I said someone started rewriting one using merlin, but then disappeared
<MercurialAlchemi>
there is definitely an issue with the env vars in gvim, it doesn't have the opam environment
<rks`_>
if you want to try to write one, def` and I would be happy to help you with the merlin' side of things
<MercurialAlchemi>
and then you want to type ':cd $YOUR_PROJECT' in vim
<MercurialAlchemi>
ingsoc: emacs is not modal like vim
<MercurialAlchemi>
that's a huge difference
mk270 has quit [Ping timeout: 264 seconds]
<ingsoc>
I was under the impression VIM might be the easiest to approach as a noob
<MercurialAlchemi>
hmm
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<MercurialAlchemi>
well, it doesn't have emacs' flexibility, but it still has around 25 years of features built in it
<MercurialAlchemi>
but you don't need to learn everything at once, or even everything at all
<MercurialAlchemi>
you do need to get used to the notion that there is a mode for changing the text, another for moving around, and another for giving commands
<MercurialAlchemi>
which is not something you find in other editors
<MercurialAlchemi>
there are plenty of good vim tutorials on the web, though, on top of the built-in one
<ingsoc>
OK, is there a "getting started with emacs for ocaml" tutorial you could recommend and I will compare experiences
<ingsoc>
and then choose
<rks`_>
well, the merlin wiki has a page for emacs too
<companion_cube>
the killer feature of fugitive, to me, is :Gvdiff <revision>
<companion_cube>
vertical diff with the same file (or another) at any point of history
<MercurialAlchemi>
mm
<MercurialAlchemi>
yeah, sounds interesting
<companion_cube>
in short, many git commands reflected in vim
<companion_cube>
open buffers on old versions, blame, etc.
<ingsoc>
is there a way to initialise module availability to utop for a specific project (some kind of init file in the project directory that is read by utop)
<ingsoc>
where I can list modules
<companion_cube>
.ocamlinit file
<companion_cube>
you can put #directory, #load and #install_printers in it
<ingsoc>
isn't this an extremely common thing to do
<ingsoc>
poke around your code in the REPL ?
<ingsoc>
ahem i mean toplevel
<ingsoc>
:)
<MercurialAlchemi>
come here to talk about ocaml, stay here to learn about vim plugins
<companion_cube>
ingsoc: I tend to have a .ocamlinit for every nontrivial project
<ingsoc>
companion_cube: ok so if i missed it, are you saying you can have a per project .ocamlinit and this overlays over the .ocamlinit in the home dir ?
yomimono has quit [Ping timeout: 255 seconds]
<companion_cube>
it doesn't overlay sadly
<ingsoc>
grrr
<companion_cube>
you might be able to #use ~/.ocamlinit though
<ingsoc>
ok
dario_ has quit [Remote host closed the connection]
<ingsoc>
so a new project generally has a cp ~/.ocamlinit proj_dir/.ocamlinit
<ingsoc>
then add per project stuff
dario has joined #ocaml
<ingsoc>
companion_cube: thanks for the info, seems to be working fine now (Mod.binding)
<ingsoc>
is there no way to run OS commands from utop
<ingsoc>
ls etc.
Sim_n has joined #ocaml
<companion_cube>
not a convenient way (I mean, not easier than just calling the corresponding ocaml function)
<ingsoc>
ok once again thanks for all your help #ocaml, can't believe I am using VIM finally lol, I think my beard just grew a bit
<MercurialAlchemi>
oh, you have macros in utop
<MercurialAlchemi>
cool
<ingsoc>
looks like today is a tooling voyage of discovery
<ingsoc>
:)
shinnya has joined #ocaml
Simn has quit [Ping timeout: 276 seconds]
IbnFirnas has quit [Read error: Connection reset by peer]
psy_ has quit [Ping timeout: 272 seconds]
leowzukw has joined #ocaml
yomimono has joined #ocaml
mort___1 has joined #ocaml
mort___ has quit [Ping timeout: 265 seconds]
mort___1 has quit [Ping timeout: 252 seconds]
yomimono has quit [Ping timeout: 264 seconds]
chouser has joined #ocaml
jabesed has joined #ocaml
ygrek_ has joined #ocaml
<companion_cube>
ingsoc: be careful not to let your beard get trapped in doors because of its length
<ingsoc>
companion_cube: looks like utop doesn't expand "~"
<companion_cube>
yes, I noticed :/
<ingsoc>
absolute path will allow you to reference base .ocamlinit
<companion_cube>
I don't know how to do it properly, guess I'll stick to copying ~/.ocamlinit into subprojects
<ingsoc>
grrrr
_5kg has quit [Ping timeout: 255 seconds]
<ingsoc>
yeah same here
<ingsoc>
:P
<ingsoc>
:)
<companion_cube>
vim my/project/.ocamlinit
<companion_cube>
:r ~/.ocamlinit
<companion_cube>
;)
_5kg has joined #ocaml
AlexRussia has quit [Ping timeout: 276 seconds]
* ggole
expanded it manually
<ingsoc>
which is fine if you work with people with the same username on all workstations :P
<companion_cube>
or you end up stealing their ~/.ocamlinit
<ingsoc>
ha ha yeah
yomimono has joined #ocaml
Thooms has quit [Ping timeout: 265 seconds]
IbnFirnas has joined #ocaml
AlexRussia has joined #ocaml
AlexRussia has joined #ocaml
AlexRussia has quit [Changing host]
Denommus has joined #ocaml
psy_ has joined #ocaml
<ingsoc>
I wonder how many people who come from the "one command and you're done" dev environment get put off when arriving in ocaml land due to frustration getting set up with a proper dev environment. I kinda had similar problems getting started with erlang so I kind of already expected things to be not completely straightforward coming to ocaml. If you compare this to say, a c#/.net user of visual studio on windows which is simply run setup.exe.
<ingsoc>
there wasa big discussion on the erlang mailing list about obstacles to getting started and a lot of the old timers were like "meh, who cares, if they can't be bothered to get down n dirty who needs em"
<ingsoc>
(not saying it is like that here) but just an observation
<ingsoc>
maybe most people on here are already quite hardcore devs/linux/vim/emacs enthusiasts
<ollehar>
ocaml is an academic language
<ollehar>
so
<tokenrove>
it's tricky. languages like ocaml and erlang accumulate a lot of different ways of doing things, and it takes a lot of work to produce that streamlined, here's-how-you-do-it workflow.
<tokenrove>
you might come to those environments and think things are way behind, but in the erlang world, stuff like rebar has massively improved things, and having recently come back to ocaml, i can say that it's way, waaay more convenient now than it was circa 2002.
<tokenrove>
and the improvement seems to have some momentum. so now's a good time to hop on the wagon. ;-)
ddosia has joined #ocaml
<ingsoc>
tokenrove: oh yeah, I totally agree, erlang has improved massively but still has a way to go. I remember when I first discovered it I kinda left it for a while as I was told OTP needs to be used for production apps and it just seemed like a complete mystery, this was before the books covered it in any depth or user friendly way
<ingsoc>
it seems to be the way, the language wasn't the major problem it was all the tooling and fframeworks
osa1 has joined #ocaml
<ingsoc>
tokenrove: so basically what you are saying is, "you don't know how lucky you are, back in the olden days things really were bad !" :)
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<tokenrove>
ingsoc: hah.
<MercurialAlchemi>
ocaml.org's "learn" page could easily have a page about tooling
<MercurialAlchemi>
er, a section, not a page
<ingsoc>
maybe I will blog something like the pragmatic starter page like, forget the standard toplevel use utop, start off the bat with OPAM, quick start ocamlbuild and sample Makefile, and quick start basic guide to get reasonable VIM or Emacs up and running with template .ocamlinit. obviously tastes vary but for a total noob to all these tools they will not care about all that they just want a reasonable environment set up in the least pain possib
<ingsoc>
use Core from the get go etc. (although this is discussed in RWO, but it would be good to put all this on a single crib sheet
<rks`_>
as for compiling, I thought RWO would mention it.
<chouser>
so, I just started using ocaml for a little side project about a week ago. I'm well over half done with my project, am making steady progress, and I've never heard of utop, opam, ocamlbuild, or .ocamlinit.
<chouser>
I've heard people mention Core, but I'm not sure what it is.
<ingsoc>
rks`_: possibly, i will check them out. I spose there is info out there. Maybe it was how I was approaching it as I thought the ocalide thing would work out then got frustrated and probably didn't start off in the most structured way. I may just document the process for my own reference anyway then if I am around and someone seems to be in similar position to me then I can at least give them a copy and see if they can provide feedback on w
<tokenrove>
ingsoc: i think that's a good idea. one of the best ways to help reduce that friction is to disseminate information about the current preferred solutions.
<chouser>
I had some small trouble beating my Makefile into a workable state, and I'm sure it's insufficient for a medium or large project, but I saw there was a stoke Makefile I could use for something larger than this.
<tokenrove>
ingsoc: the other thing is that blog posts show people considering a language that there is traction there. so i wouldn't worry about it duplicating some other source of that information.
<chouser>
My trouble had mainly to do with the various ways to use "ocaml" "ocamlc" and "ocamlopt", and the purpose of all the different .ocx. ocax, etc. files. But I limped along not knowing the difference between bytecode and native files for a while.
<ingsoc>
chouser: I am no doubt that approach has worked great for you and I am not saying it is impossible to start off. I guess I was coming with the intention of starting off with the current community best practices or tooling from the get go, this may not be the best way to start off for some people I guess everyones expectations and requirements are different
<ingsoc>
I am not doubting*
<tokenrove>
chouser: i find oasis and ocamlbuild useful, as i too originally had hand-written makefiles, then the ocaml makefile that's out there, then omake. i would hope a new user wouldn't have to go through all that any more.
<ingsoc>
chouser: this is exactly what ocamlbuild solves
<ingsoc>
the mystery of compilation
<ingsoc>
well it hides the magic
<ingsoc>
so you can focus on dev
<ingsoc>
then you can dig under the covers when you need to
<chouser>
does it do dependency resolution across multiple source files?
<ingsoc>
like i said it depends on how you want to approach things
<tokenrove>
on one project i used cook (a make replacement). i always meant to publish my cook recipes for ocaml, but there's no need now.
<rks`_>
ingsoc: ok :) (i'm not discoureaging you from writing somethnig, I was just curious)
<tokenrove>
chouser: ocamlbuild deals with dependencies correctly
dario has quit [Remote host closed the connection]
<chouser>
interesting. So I probably would have been/would be better off with ocamlbuild, but I didn't even know it existed.
<ingsoc>
chouser: chouser: exactly
<chouser>
I mean, my problem was not that I was frustrated while trying to use it, but that I wasn't trying to use it.
<ingsoc>
even ROC only mentions it but only covers basic info on compiling in chapter 4 then there is another chapter about it at the end of the book (not read it yet)
<tokenrove>
chouser: i assume you are at least using ocamldep to generate dependency information and then including that output in your makefile?
<ingsoc>
RWO*
<tokenrove>
the thing i always hated about that was the build directory littered with ocamldep output, and the pain if you get those rules wrong
<companion_cube>
this is a thing ocamlbuild does well: put all the geenrated stuff in _build/
<ingsoc>
you just reference your entry module (one with let () = )
<ingsoc>
and put a suffix of mod.native/byte
<ingsoc>
and it does its magic afaict
<chouser>
tokenrove: nope, never heard of ocamldep, though if my project were any larger I would have gone looking for such a thing.
bytbox has quit [Remote host closed the connection]
hellofunk has joined #ocaml
<chouser>
ingsoc: interesting, thanks.
<tokenrove>
chouser: oh man. yeah, managing the dependencies manually is just a nightmare. you need to at least use ocamldep, but i recommend just skipping straight to ocamlbuild unless you need to integrate with other make rules.
<ingsoc>
info is out there it seems but you have to know about keywords to google for
<ingsoc>
maybe just needs ocollating to a more digestible format
<ingsoc>
will write something up and link to a gist
shinnya has quit [Ping timeout: 245 seconds]
<tokenrove>
definitely
<chouser>
yeah, I just have a list of my 5 source files in the "right order" in my makefile. Definitely only acceptable for a small project.
<ingsoc>
chouser: are you still editing in a basic text editor then running a compile and then looking at line number referenced for errors then going back into your editor to modify the rinse repeat ?
* chouser
blushes
<ingsoc>
cos that is not productive imho, unless you have the memory of rain man and never make mistakes
<chouser>
My basic text editor is emacs. Does that give me any cred?
<tokenrove>
this is why it's good for people to publish their workflows, and for them to be linked widely.
<ingsoc>
well it is fine if it is configured correctly :P
<tokenrove>
chouser: are you using merlin and tuareg mode?
<ingsoc>
I just started using VIM about 2 hours ago
<ingsoc>
and have code completion and error reporting within the editor
<ingsoc>
when saving
shinnya has joined #ocaml
<ingsoc>
but had to ask around
<chouser>
I think I installed tuareg mode, but I'm not sure I'm using it well, or maybe at all. Though something in my ocaml buffers makes emacs sorta lock up sometimes, and I have to ^G to keep typing.
mort___ has joined #ocaml
<ingsoc>
I had major pain with ocalide (eclipse plugin) before that because it seems (afaict) that it is not geared up for using OPAM installed runtime and libs
BitPuffin has joined #ocaml
<tokenrove>
this is also a great thing about irc, though; it's another channel by which to discover different ways people do things.
<ingsoc>
wasted ALOT of time
<tokenrove>
chouser: merlin is awesome. you should give it a try if you have the time.
eikke_ is now known as eikke
eikke has quit [Changing host]
eikke has joined #ocaml
* ingsoc
agrees that merlin is cool
<ingsoc>
chouser: do you use utop ?
<ingsoc>
as your toplevel REPL
<chouser>
no. rlwrap ocaml
<chouser>
lately in an emacs shell buffer
<chouser>
for some perspective, I'm really "just visiting" OCaml. I don't intend to "move in".
<chouser>
So I'd like to capture what I learn about the build process in the Makefile, so looking into ocamlbuild may be worthwhile.
<ingsoc>
chouser: oh, ok, and btw I wasn't criticising you, I was just offering some info i just gained today to maybe at least make you think about what is available
<chouser>
And if there's something easy I can do so that my cursor is sent to the location of the compile error, that might also be worth while.
<tokenrove>
are you building with M-x compile?
<chouser>
But I'm not going to spend days customizing my development environment right now, because I don't think I'll be around long enough for that to pay off.
<chouser>
ingsoc: no offense taken at all.
<companion_cube>
be careful chouser, you might get to like the language
<chouser>
everyone here has been absolutely friendly and quite helpful.
<chouser>
companion_cube: fair enough!
<ingsoc>
this channel has actually spurred me on to stick with it as the help has been superb and with no flaming (even when I clearly was being noobish)
<chouser>
Though I'm afraid I've been ruined by lisp. I sure do miss my macros.
<ingsoc>
chouser: i think there is a preprocessor for ocaml where you can introduce new syntax (i think)
<ingsoc>
probably not as straightforward as lisp macros
<ingsoc>
but there's a manhole there to do things like it
<chouser>
ingsoc: I've seen mention of it, such as for monad syntax support, right?
milosn_ has joined #ocaml
<tokenrove>
chouser: i'm also a lisp person, so i hear you on macros. ml does have a lot to offer, though. btw, C-x ` will bring you to the next error if you compile with M-x compile.
<ingsoc>
(I may be talking rubbish here though) someone clarify or deny
<ingsoc>
:)
<tokenrove>
there are a variety of ways to extend ocaml's syntax, but they're a far cry from macros as lisp sees them
<ingsoc>
fair enough
<tokenrove>
they're more like erlang's parse transforms
<ingsoc>
btw macros scare me a bit, I am not sure I would like to support a codebase where the author went macro crazy
<ingsoc>
it would be hard to know what the hell is going on
<companion_cube>
chouser: sad that we have to choose between good macros and good typing :/
<chouser>
companion_cube: yep. I still hope that someday that will change.
rgrinberg has joined #ocaml
<tokenrove>
ingsoc: good tooling helps. the same is true of c++ and a codebase where operator overloading has been abused.
<chouser>
companion_cube: Have you looked at all at clojure's core.typed or Typed Racket?
<pippijn>
I've decided that fancy gadt-based packet formats are not worth it
<companion_cube>
chouser: I heard about core.typed, but if the whole ecosystem doesn't use types you're screwed :s
<pippijn>
at the end, I get a (tuple, (list, (structured, (like, this))))
<chouser>
ingsoc: There is indeed danger there, but I'm not sure it's more dangerous than high-order functions. Have you seen some of those multi-level combinators? Good judgement is always required.
<companion_cube>
but there's progress indeed
leowzukw has quit [Ping timeout: 246 seconds]
<tokenrove>
sbcl also basically has what those people are calling gradual typing, but there are other problems with that ecosystem.
<companion_cube>
scala has macros too, afaik
<pippijn>
and then I need to translate that to a useful record, anyway
<pippijn>
companion_cube: scala macros are awesome
<pippijn>
I want those in ocaml
leowzukw has joined #ocaml
<ingsoc>
chouser: yeah, there are many ways to shoot yourself in the foot. I guess you just have to be pragmatic and hope you can spot when things are getting out of hand. I guess these things are hard earned lessons through experience. I am still a relative newcomer to development so I am sure I will fall into the same traps of others
cdidd has quit [Remote host closed the connection]
<ingsoc>
chouser: are you from Common Lisp or clojure ?
<ingsoc>
I played with clojure for a bit and I definitely intend to learn it in future, ironically it has a SUPERB eclipse plugin (counterclockwise)
<ingsoc>
: / :)
<chouser>
ingsoc: Clojure
<chouser>
I learned Common Lisp a little first, but it never "stuck"
<ingsoc>
chouser: i have heard great things about clojure from people using it
<ingsoc>
if I had to use the Java VM i would deffo jump in
<chouser>
I get to use it at work. It's a very practical language, with a lot of tools to help you manage whatever kinds of complexity the real world throws at you, all while providing a small, clean (immutable, functional) base.
cdidd has joined #ocaml
<chouser>
I do wish it had a kind of gradual static typing that I'm not sure exists in any language (so maybe my wish is nonsensical). But being a lisp, there's some chance such a thing could be added later, so I continue to hope. :-)
<chouser>
OCaml's mix of highly inferred static typing plus lack of extremism on the subject of immutability is quite interesting.
badkins has joined #ocaml
<chouser>
Do experienced users find that type errors the compiler finds at one place in the code are often fixed by a change in a completely different place in the code?
<ingsoc>
I learned enough c/c++ to be dangerous, then dabbled with java/.net then found python and thought wow this is liberating not having to pander to the compiler all the time. Then I built a more substantial program (using erlang this time) and found I really liked functional programming but I started thinking there are some aspects of static typing that would help in a lot of areas of my code. This led me to ocaml where (hopefully) you get the
<chouser>
ingsoc: cut off at "you get the..."
<ingsoc>
you get the static typing without most of the downsides
<ingsoc>
(type inference)
enitiz has joined #ocaml
enitiz has quit [Read error: Connection reset by peer]
milosn has quit [Remote host closed the connection]
milosn_ has quit [Remote host closed the connection]
milosn has joined #ocaml
zwer_h is now known as zwer
IbnFirnas has quit [Read error: Connection reset by peer]
Sim_n is now known as Simn
<companion_cube>
ingsoc: interesting trajectory
rgrinberg1 has joined #ocaml
<ingsoc>
companion_cube: this has been over approx 2.5 years since I left my day job to write some software (and learn to program properly - whatever that means)
<ingsoc>
I went from writing a multi-threaded networking server (and all the horrors that entails) then I switched to using asynchronous callback based programming, then to a user space cooperative green thread library to then the nirvana of concurrency that is erlang. it was a fun ride shame I never got my product finished
<ingsoc>
:D
darkf has quit [Quit: Leaving]
<ingsoc>
companion_cube: what do you use ocaml for
<blech___>
ingsoc, that preprocessor does exist. Look at camlp4
<blech___>
chouser, yeah, finding the solution in a seemingly unrelated part of the code is pretty common. It's likely that a type was inferred incorrectly based on some weird use elsewhere so when you try to use it correctly you'll run into errors
<chouser>
blech___: Right. Interesting. I think that may be a inescapable consequence of ubiquitous inference.
struktured has quit [Ping timeout: 245 seconds]
<blech___>
sooo worth it, though
<chouser>
Do experienced OCamlers use defensive type declarations?
<blech___>
I'm middling at best but for me? Not so much. I can see the use for it when you're concerned about the inference engine and it's good for enforcing the type and also contributes to the idea of self-documenting code
<chouser>
ok. Interesting, thanks.
<blech___>
but most of the time my logic is if the type inference engine isn't getting it right it's because I'm writing bad code
<blech___>
so I leave it out almost as a training exercise
<def`>
chouser: not really defensive, but I like first putting some types before putting the actual values
<def`>
that is, I model the space of my values using types, then I define the interface with those types, and after that I implement
paradoja has joined #ocaml
octachron has quit [Quit: Leaving]
<blech___>
Does ocaml have a strong convention for documentation? I'm thinking of things like python's triple quoted strings.
<MercurialAlchemi>
blech___: I think a very common convention is the "two lines readme and that's it" :(
<chouser>
def`: ah, sure. I can see how that would help avoid the distant-error problem. It also sounds like an approach I've heard advocated by haskell and idris users.
<companion_cube>
chouser: what do you mean exactly by "defensive type declaration"?
<def`>
chouser: yep, as usual it's not a silver bullet, it depends on the kind of work you do, but I am quite pleased with it ;)
<chouser>
companion_cube: oh, like sprinkling in type annotations on function args or return values, even when they could be inferred
<MercurialAlchemi>
writing type declarations helps when reading the code
<companion_cube>
well, many people write .mli files for this precise reason
thomasga has joined #ocaml
<companion_cube>
o/ thomasga
<MercurialAlchemi>
on the other hand, if you have to sync the type declarations in your .ml with your .mli, it's a bit much
<def`>
bonne fête \o/
* chouser
reads about .mli
<thomasga>
gné?
uris77 has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
rand000 has joined #ocaml
ebzzry has quit [Remote host closed the connection]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
Tamae has quit [Ping timeout: 246 seconds]
Tamae has joined #ocaml
IbnFirnas has joined #ocaml
dario has joined #ocaml
avsm has joined #ocaml
leowzukw_ has joined #ocaml
leowzukw has quit [Ping timeout: 272 seconds]
jneen|zzz is now known as jneen
Sim_n has joined #ocaml
<ingsoc>
is there a way to set up vim for reasonable indentation spacing
<ingsoc>
possibly intelligent
<ingsoc>
what is the style guide ? tab-> spaces ?
<ingsoc>
currently tab width is 9 : /
Simn has quit [Ping timeout: 276 seconds]
Thooms has joined #ocaml
<companion_cube>
I don't know if there's a real standard, but 2 spaces seems common
<rks`_>
ingsoc: now would be good time to read the link I gave you earlier.
<rks`_>
(the post on opam.ocaml.org/blog)
<ingsoc>
ok
destrius has quit [Quit: Leaving.]
leowzukw_ has quit [Ping timeout: 272 seconds]
ygrek_ has quit [Ping timeout: 256 seconds]
<MercurialAlchemi>
ingsoc: ocp-indent is your friend
<ingsoc>
yeah just following this
<MercurialAlchemi>
otherwise, tabs are a bad idea whatever the language (unless you're in a Makefile, obviously)
<MercurialAlchemi>
'set et', 'set sw=2', 'set tabstop=2' in your .vimrc will give you 2 spaces when you press tab for everything
<rks`_>
why are tabs a bad idea MercurialAlchemi ?
<MercurialAlchemi>
'au Filetype ocaml $command' lets you have settings specific to ocaml files
<MercurialAlchemi>
rks`_: because nobody uses the same width to represent them
aluuu has joined #ocaml
<MercurialAlchemi>
"oh, but it's aligned properly in *my* editor" is not a version of "oh, but it works on my machine" I want to deal with when doing code review :)
<ingsoc>
i guess it is the problem when people mix tabs and spaces in the same file
<ingsoc>
then things go bad so maybe just standardise on spaces ?
<MercurialAlchemi>
ingsoc: that's people who haven't done enough Python
<Drup>
and apparently, there are several vimers around right now, the vim part needs review :D
badkins has quit []
<def`>
ingsoc: ocp-indent-vim does the same job as ocp-indent.vim, but with slightly better integration (notably, indentations integrate better with undo buffer)
<def`>
'undo-ring'
<ingsoc>
Drup: would this conflict with what I have entered manually in my .vimrc file already ?
<ingsoc>
it says it writes into the respective editors config file
<def`>
ingsoc: use either ocp-indent.vim or ocp-indent-vim, otherwise, one will be chosen quite arbitrarily
ollehar has joined #ocaml
<def`>
and no, this doesn't conflict
ollehar has quit [Client Quit]
<rks`_>
MercurialAlchemi: that's only a problem if you mixed tabs and spaces
lpw25 has quit [Ping timeout: 245 seconds]
<rks`_>
which is only ever done by emacs users
slash^ has joined #ocaml
<rks`_>
but otherwise using tabs for indentation seems reasonable.
<Drup>
except it's not consistent with most other ocaml users, which is quite bad.
<mrvn>
I indent too often to have tabs be workable
<ingsoc>
after installing/configuring ocp-indent-vim
<ingsoc>
let x y = "if i press return here then the next line is spaced up to being directly under the "=" sign
oriba has joined #ocaml
<ingsoc>
is that correct ?
<mrvn>
ingsoc: so what's the point of pressing return?
<def`>
ingsoc: yep
<Drup>
is it ?
<mrvn>
rks`_: the emacs default of replacing 8 spaces with a tab on indent is horrible. Luckily it's just a few clicks to change that.
<Drup>
the indentation should be 2 spaces for the next line
<def`>
directly under
<def`>
ahhh, yep not correct
<ingsoc>
seems it is not installed then and I am using the default of 8 spaces
<rks`_>
mrvn: unluckily, very many people dont change that.
<ingsoc>
it just so happened the expression made it so it alighned with the "=" lol
<mrvn>
I hope someone will fix the tuareg mode to know about GADTs at some point.
<dario>
I was wondering if ingsoc was one of those time-travellers that lurk in IRC...
manizzle has joined #ocaml
<ingsoc>
user-setup is not available because your system doesn't comply with ocaml-version >= "4.02".
<dario>
ingsoc: install OCaml 4.02.1
<dario>
Run "opam switch 4.02.1"
jgjl_ has joined #ocaml
<ingsoc>
and this is because unfortunately i run ubuntu 32bit and i couldn't get anything higher than 4.01.0 working
<ingsoc>
this was my first hurdle from last week
<ingsoc>
so maybe this is a dead end ?
<ingsoc>
:(
<dario>
ingsoc: any strong reason why you're running 32-bit Ubuntu?
<ingsoc>
:'(
<dario>
(Say, you have a 32-bit CPU)
Thooms has joined #ocaml
<Drup>
4.02 doesn't run on 32 bits ? really ?
jgjl has quit [Ping timeout: 264 seconds]
<ingsoc>
dario: historical, i used to be a windows guy, i decided to dual boot with ubuntu, at the time canonical recommended 32bit for reasons that elude me now
<ingsoc>
i installed it and the rest is history,
<dario>
Btw, just last week I installed 4.02 on a 32-bit machine (ARM) and it was fine...
* MercurialAlchemi
is trying to teach OCaml to his 9-yo daughter
<ingsoc>
i am gonna move to 64bit at some point
<dario>
ingsoc: can you try installing 4.02 again? (run "opam switch 4.02.1")
<ingsoc>
but i will be buying a new machine to run it and haven't got round to it yet
<ingsoc>
ok
<Drup>
MercurialAlchemi: as long as you give her a LOGO library, it will work :D
<dario>
In any case, OCaml very much prefers 64-bit systems...
<MercurialAlchemi>
Drup: LOGO?
* fds
began programming with Logo.
<ingsoc>
dario: i found that out last week
<ingsoc>
: /
manizzle has quit [Client Quit]
<Drup>
the logo graphical model is *great* for beginners
<MercurialAlchemi>
oh, dear me, this looks old
manizzle has joined #ocaml
<fds>
I was about 13 though, I think.
<MercurialAlchemi>
well, we've started with a simple "game" where characters from her favourite show battle each other
<dario>
I took part in the IOI in 94, and there were some people competing with LOGO...
<MercurialAlchemi>
"daddy, what's a random number?"
<Drup>
MercurialAlchemi: it's like the brainfuck of graphical libraries
<dario>
The other accepted languages were Turbo C and Turbo Pascal...
<Drup>
MercurialAlchemi: note that I'm talking about the turtle model, not the programming language itself :p
<dario>
ingsoc: I have to leave. Do try getting 4.02 installed on your 32-bit system, and consider upgrading to 64-bits ASAP!
<ingsoc>
dario: ok 4.02.1 appears to work now
<dario>
ingsoc: great! Good luck with the rest. Time to prepare dinner...
<ingsoc>
is there any way of moving over/copy/export config of installed packages in an ocaml version to another in opam
<ingsoc>
opam switch <newer_ver> is literally a fresh ocaml
<Drup>
ingsoc: opam switch export/import
<MercurialAlchemi>
Drup: I'm not sure she is ready for L-systems yet
<MercurialAlchemi>
or me, for that matter :)
<Drup>
ahah, probably not
* MercurialAlchemi
reads some more about L-systems
<MercurialAlchemi>
it looks fascinating (litterally)
WraithM has joined #ocaml
<Drup>
I must say I have a certain passion for them
<Drup>
no use whatsoever, though =')
<ingsoc>
i am trying a opam switch reinstall <my_version>. dunno if installs ever get in a bad shape
<ingsoc>
but last ditch attempt at getting indent working
slash^ has quit [Read error: Connection reset by peer]
<MercurialAlchemi>
it's not immediately obvious how you control the shape you get from the grammar, though
<MercurialAlchemi>
Drup: I could imagine using that to generate props in a game, for instance
<MercurialAlchemi>
if I made games :)
<Drup>
MercurialAlchemi: oh, sure
<Drup>
I know Civ IV used to generate city with a custom made Lsystem engine
<Drup>
but it was poorly documented, never managed to hack it
<MercurialAlchemi>
right
zwer_b has joined #ocaml
<Drup>
but I mean, afaik, nobody uses lilis and I don't have uses myself :D
<Drup>
MercurialAlchemi: you can develop an intuition of what is going to be the result quite quickly, in fact
<MercurialAlchemi>
ok
zwer has quit [Ping timeout: 250 seconds]
<MercurialAlchemi>
(at least I'll have learned something cool today)
BitPuffin has quit [Ping timeout: 265 seconds]
yaewa has quit [Quit: Leaving...]
moei has joined #ocaml
unix_beard has joined #ocaml
bugabinga has quit [Remote host closed the connection]
<nicoo>
Drup: I sometimes use LiLiS to displa nice images :)
<nicoo>
display*
tane has joined #ocaml
<companion_cube>
lilis was useful as a source of benchmarks for iterators ;)
uris77 has joined #ocaml
<Drup>
nicoo: real story : My sister used lilis for one of her art projects
<nicoo>
\o/
<nicoo>
Drup: Can you show us pictures of the result ?
<companion_cube>
quite useful in the end, Drup, then
<Drup>
nicco : https://drup.github.io/LILiS/dev/spin_it.svg that, but it was printed in a slightly more interesting way and since I have no artistic fiber whatsoever, I'm not trying to explain anything about it :D
<nicoo>
companion_cube: Given that there are other L-systems engines, and that Drup spent quite some time on it ?
<nicoo>
Drup: Fancy
<nicoo>
Also, there is a difference between having an artistic fiber and having an art-critic fiber :þ
<nicoo>
Though I'm reminded that Nouveau did some very stupid (but pretty!) stuff on the screen while I was talking to an artist, so she filmed it ^^
IbnFirnas has joined #ocaml
<Drup>
nicoo: It's Art Nouveau !
<Drup>
:D
* Drup
jumps outside of the room.
<nicoo>
<3
<nicoo>
Drup: No, come back
<nicoo>
The pun was really good \o/
mort___ has joined #ocaml
Tekk_ has quit [Remote host closed the connection]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<companion_cube>
:)
Tekk_ has joined #ocaml
<tokenrove>
MercurialAlchemi: you might find shape grammars to be an interesting alternative to l-systems. i have some pieces of an implementation of the cga shape grammar in ocaml i wrote last year that i need to release.
jgjl_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tokenrove>
but there are improvements on those techniques, and there are some aspects of the approach proposed in that paper that are kind of hacky
<Drup>
tokenrove: I don't understand the "split rule" part
<tokenrove>
see the earlier papers on split grammars, e.g. Instant Architecture from 2003 iirc
<Drup>
(for now, I don't see how it's more than Lsystem + well chosen primitives for 3D stuff)
<tokenrove>
the ways grammars are intepreted are extremely constrained, and there's this whole matrix-grammar-like LOD stuff. they talk about how it's not an L-system in a couple of the papers.
<tokenrove>
their assertion is basically that L-systems are good for generative stuff, like plants, while shape grammars are good for constrained, highly-regular stuff, like buildings.
<Drup>
that's how they are used originally, but that's not constrained in the system
avsm has quit [Quit: Leaving.]
malc_ has quit [Quit: leaving]
<tokenrove>
apparently the primary difference is that shape grammar rule application is sequential, while L-system rule application is in parallel.
<tokenrove>
i should say that the term "shape grammar" is actually pretty ill-defined as there have been many different interpretation rules since the 70s
manu3000 has left #ocaml [#ocaml]
rwmjones_afk is now known as rwmjones
<Drup>
by "sequential" you mean "like a CFG" then ?
<Drup>
then indeed, it's not a L system at all :p
<Drup>
"Therefore,CGA Shapeis a se-quential grammar (similar to Chomsky grammars)."
<Drup>
right.
<Drup>
so, yes, it's a fancy extension of CFG with special purpose things for 3D volumes, ok
vanila has quit [Quit: Leaving]
manud has joined #ocaml
<Drup>
tokenrove: didn't know there was a community working on this kind of grammars, though, it's interesting
<tokenrove>
yes, i don't mean to take anything away from L-systems at all, just wanted to point out an interesting and not-so-widely-known family of related techniques
<Drup>
yep, it's quite interesting
<tokenrove>
i will let you know when i make a first release of my implementation of CGA shape in ocaml.
<Drup>
tbh, it's mostly the "grammar-y thingy to do graphical stuff" that I like, so it's equally interesting to me, I just wanted to understand precisely why they needed a new tool :p
<Drup>
tokenrove: is it/going to be public ?
mengu has quit [Remote host closed the connection]
Leonidas has quit [Ping timeout: 265 seconds]
Leonidas has joined #ocaml
Nahra``` has quit [Read error: Connection reset by peer]
<tokenrove>
Drup: definitely will be open source. it's just stuck under a stack of other hobby projects i'm trying to finish and release this year right now.
<Drup>
I know the feeling :D
gperetin has quit [Ping timeout: 272 seconds]
struk|work has quit [Ping timeout: 246 seconds]
gperetin has joined #ocaml
<Drup>
tokenrove: I'm curious about the engine
nopf has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
vpm has quit [Ping timeout: 264 seconds]
Submarine has quit [Ping timeout: 255 seconds]
waneck has joined #ocaml
ingsoc has quit [Quit: Leaving.]
jgjl has joined #ocaml
nopf has joined #ocaml
vpm has joined #ocaml
Hannibal_Smith has joined #ocaml
ivan\ has quit [Remote host closed the connection]