adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | | OCaml 4.07.1 release notes: | Try OCaml in your browser: | Public channel logs at | Due to ongoing spam, you must register your nickname to talk on the channel
malina has quit [Remote host closed the connection]
zolk3ri has quit [Quit: Lost terminal]
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
keep_learning has quit [Remote host closed the connection]
Ou42 has joined #ocaml
<Ou42> hello. noobie here -- full disclosure I am in the FUN MOOC class ATM -- that said, I am having trouble understanding what "type 'a t" means. What is its shape? Does 'a have to be 'a? or can it be "a" by itself without the apostrophy? What is t? It's like another type, right? but toplevel doesn't require any of that. I can type that in toplevel and it accepts it, but what is it?
MadcapJake has joined #ocaml
<Ou42> @macapjake: hello
mfp has quit [Ping timeout: 246 seconds]
pierpal has joined #ocaml
<Ou42> hello
<on_ion> has to be 'a , don't know why
<on_ion> in haskell is just a
<Ou42> ah-ha! progress
<Ou42> so 'a in OCaml.
<on_ion> yep
<Ou42> but i thought i saw type a somewhere... will look.
<Ou42> from lecture slides, "type t" why is "t" allowed but "a" not? weird.
juxt[m] has joined #ocaml
<on_ion> different thing there. like "type a' t" without the a'
<Ou42> got a min? I'll try in the ocamlpro...
<on_ion> thats about the extent of my knowledge, sorry to say
<Ou42> no worries! you have helped.
<Ou42> i tried, "type a" and it worked... but as you said "type a t" does NOT
<Ou42> so that is a start!
<on_ion> ok, good =) tried merlin?
<Ou42> no, what's that?
<on_ion> or i wonder how is your editor support , to tell you things while you type rather than compiling to check
<on_ion> its a tool for emacs. nothing to worryu about right now
<Ou42> i haven't made the jump to emacs.
<Ou42> \the MOOC course is all in browser
<on_ion> =)
<Ou42> i just use try.ocamlpro when i don't want the class spying on me
<Ou42> :D
<Ou42> they probably share info though.
<on_ion> who knows
<on_ion> info by nature or definition is shared tho
<on_ion> the stuff of communicatingz
<Ou42> shhhh don't tell!
<on_ion> =)
<Ou42> so how long have you been using OCaml?
<on_ion> not much. i wrote some stuff in it and i found it natural to work with; was porting a 2d graphics engine thing from haskell, and ocaml translated really well
<on_ion> havent got further into anything too serious, in evaluation/research stages of a project right now .
<Ou42> and you come from haskell?
<on_ion> directly, yeah
<Ou42> interesting... why the switch?
<Ou42> because mutation is the bomb? and haskell is a silly lang? :D
<on_ion> some lisp and c. but haskell is not lending itself to hmm creative design
<on_ion> it is better for if there is already a spec to implement
<on_ion> ocaml is more versatile during dev eg prototype and experiment and explore
<Ou42> i'm new to FP. so it's all difficult.
<on_ion> haskell is like chipping stone, it is not easy to go back
<Ou42> i haven't tried hasekll but i've seen some code.
<on_ion> oh? its just recursion
<on_ion> FP is just "not in any specified order" so the opposite of sequential instruction
<Ou42> i never liked recursion. the MOOC has been a trip.
<on_ion> what is MOOC ?
<Ou42> Massively Online Open Class ( or Course )
<Ou42> free in this case.
<on_ion> ohh
<on_ion> understood. its in french? might watch
<Ou42> it is free... so if you just wanted to dabble... what's to lose? if you have the time.
<Ou42> no, english with french accents.
<on_ion> no attention span these days for video longer than minute =)
<on_ion> ah french
<Ou42> i have learned to skip the videos. i prefer video. it's a sad state of the world!
<Ou42> bonjour!
<on_ion> where have you come from until ocaml?
<on_ion> bonnui
<Ou42> python
<on_ion> ohhh. have you seen Julia at all?
<Ou42> the fractal? j/k j/k no, i've heard of it. but no. Just a little Elm and even less Haskell
<on_ion> elm is similar to haskell, kinda counts . check her out you might like it
<on_ion> got python syntax and its great for smart things
<Ou42> interesting
<Ou42> if i may... why not use Julia for your 2D project?
<on_ion> because of the python-like syntax =)
<on_ion> i am looking at scheme at the moment, and ocaml. (from common lisp also)
<on_ion> ocaml syntax is very particular. not sure if i have the headspace for all the variations on similar forms
<Ou42> that's a tough one.
<Ou42> i did come across a haskell lib for a game engine... poss 2D...
<on_ion> hm never heard of it
<on_ion> julia was implemented in scheme... but i've got the tools for the lisp syntax so ive already got the tools
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 272 seconds]
Ou42 has quit [Quit: Going offline, see ya! (]
cgenie[m] has joined #ocaml
steenuil_ has joined #ocaml
steenuil has quit [Ping timeout: 252 seconds]
_whitelogger has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
awal has joined #ocaml
awal is now known as Guest80198
Guest80198 is now known as awal
tennix has joined #ocaml
tennix_ has joined #ocaml
tennix_ has quit [Client Quit]
jao has quit [Ping timeout: 244 seconds]
tennix has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
kakadu has joined #ocaml
sagotch has joined #ocaml
ggole has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
marvin2 has quit [Ping timeout: 244 seconds]
_whitelogger has joined #ocaml
<bartholin> I tried to understand the Yoneda's lemma by implementing it in OCaml, the result is a bit disappointing
fraxamo has joined #ocaml
orbifx1 has joined #ocaml
asymptotically has joined #ocaml
jnavila has joined #ocaml
mfp has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
ygrek__ has joined #ocaml
webshinra has quit [Ping timeout: 252 seconds]
ygrek_ has quit [Ping timeout: 252 seconds]
asymptotically has quit [Remote host closed the connection]
asymptotically has joined #ocaml
orbifx1 has quit [Ping timeout: 240 seconds]
orbifx1 has joined #ocaml
zolk3ri has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
Guest3475 has joined #ocaml
alphor has quit [Ping timeout: 252 seconds]
alphor has joined #ocaml
Guest3475 has quit [Read error: Connection reset by peer]
jnavila has joined #ocaml
Haudegen has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
jnavila has joined #ocaml
jbrown has quit [Ping timeout: 252 seconds]
jnavila has quit [Ping timeout: 252 seconds]
Habib has joined #ocaml
<Habib> I want to read Real World OCaml, but I'm not sure if I should read version 1, which may be out of date, or the dev. version, which may be insufficiently complete. What do people here think?
<bartholin> read the dev version
zolk3ri has quit [Ping timeout: 256 seconds]
<hannes> I recommend the dev version as well. if there's something unclear/incomplete/missing/incorrect, report an issue :)
<Habib> Thanks bartholin & hannes.
<Habib> hannes: do you know what the state of it is in terms of completeness?
<hannes> Habib: no
<octachron> and it is easier to spot missing contents than out-of-date contents
<Habib> That's true.
<bartholin> Habib: afaik, it is complete
<Habib> Thanks, bartholin. Dev. version it is, then.
<Habib> Thanks guys.
orbifx1 has quit [Ping timeout: 272 seconds]
zolk3ri has joined #ocaml
<Habib> Just to make myself known here, I'm a Rubyist in my day job, but I've been learning Haskell for a couple of years now (ramping up). I love Haskell, but one thing that's bothering me is its slow compilation speed. I've seen OCaml mentioned in the past here and there, but I've always been turned off by its (IMO, ugly) syntax.
<Habib> I've been reading more about it lately, though, and my eyes are adjusting, and the compilation speed, and the predictability of runtime performance — even though I love Haskell's laziness — is compelling enough that I've decided to give it a go. The learn-a-new-language-itch I get is back, and it's telling me OCaml is the one which can scratch it.
<Habib> The usecase I'm hoping to fill with OCaml is small scripts. Not that it doesn't have the power I need for larger programs; it's just that Haskell performs really well (especially compared to what I'm used to in Ruby) when I write larger programs with it, so I have no need for another ML language there at the moment, but despite its great scripting support, I've found the constant-time overhead at program boot to be annoying enough that I'm willing to learn OCam
<Habib> for those smaller programs.
<Habib> BTW, I have to say, the tooling is really well done for such a small community. Merlin is really great; I still don't have a similar plugin as good for my Haskell development, which has an even bigger community.
<ggole> If you don't care for the syntax, you could look at Reason
<ggole> It's essentially a curly-brace syntax skin over OCaml
<Habib> Yeah, I'm aware of Reason, and it doesn't look too bad (although curly braces aren't my thing at all). I thought it targeted JS, though?
<ggole> It isn't specific to JS, no
orbifx1 has joined #ocaml
<Habib> Tto be honest, when going for a language, I prefer to pick the original, as opposed to a reskinning of it. I appreciate what Elixir is doing for Erlang, for example (more than a reskin), and I may well learn it at some point, but it will be after I learn Erlang.
<Habib> I don't know, I just prefer to learn the original syntax (or the original anything) before I dismiss it out of hand and pick the ostensibly improved version. Even though it may be ugly to my eyes, there may still be some things I can pick up if it's so different.
<Habib> It's the same reason I learn new languages in the first place. The syntax may be ugly, but it's also different and that has its own draw. i may well take a look at Reason at some point, so thanks for the correction. However, I will learn the original syntax first, just because that's what I do :).
<Habib> I like clean syntax, but since I'm learning, I may as well approach OCaml's syntax with an open mind.
<ggole> Fair enough.
<Drup> I'm curious what you dislike so much in OCaml's syntax. I never quite understood people who considered it ugly
<Habib> Well, if I had a code snippet in front of me, I could point out a few things. I've just never found the code snippets I've seen particularly appealing. Some of it is surely subjective.
<Habib> Some of it is also surely lack of understanding. For example, I didn't understand all the apostrophes in type variables. Now I know that they're supposed to denote type variables, it makes more sense. I still prefer Haskell's way of having the type variable after the type constructor and the case convention instead of the apostrophe, but now that I understad it, OCaml's way isn't quite as ugly to me as it was before.
<Habib> The double semicolon at the end of certain lines turned me off, especially as I can't understand why it has to be the case, or what the pattern to choosing single or double or none, it makes it seem arbitrary and unconsidered (though I'm sure it was considered).
<Drup> Ah, that one has a simple answer: never use ";;" in programs. It's only there for the toplevel.
<Habib> Also, I think some of it is just being spoilt by languages that do it “cleaner”, so even if the syntax is actually fairly good in the wider scheme of things, you see things that seem like noise. For example, JavaScript seems okay until you discover CoffeeScript.
<Habib> For example, the first code snippet in this Wikipedia page which uses match is quite clean, even comparable to Haskell's case statement. The thing is, though, case statements as a function body turn me off, as I would generally prefer to pattern match on the function arguments themselves. Like:
<Habib> >f [] = 0
<Habib> >f (x:xs) = …
<ggole> Duplicating the function name always really annoyed me with that style
<Habib> Yeah, I started being aware of that too, quite recently.
<Habib> So I guess even a language that seemed quite nice on first meeting, your perception can change.
<Habib> And the brackets being common in Haskell pattern matching doesn't mesh with Haskellers hating brackets (including myself).
jnavila has joined #ocaml
<hannes> Habib: you are aware that the first example could as well be written as ?
<Habib> Another thing that turned me off about OCaml in particular is that you have to use +. for floating point numbers, and similar kinds of non-polymorphism, instead of just using polymorphic versions. I guess that's not quite a syntax problem, but still.
<hannes> (i.e. instead of .. xs = match xs with .. you can write .. = function ..
<Habib> Ah, I was not aware of that.
<Habib> I wouldn't say I'm immersed in OCaml yet, but none of the code I've seen uses that style.
<Habib> Thanks, that seems nicer in my eyes.
<hannes> Habib: + vs +. -- there's a line of work called modular implicits which addresses this issue -- but it is work-in-progress
<Habib> And Drup, thanks for the correction about ";;"
<Habib> Ah, cool. Looking forward to it.
<Habib> I think familiarity will drive a lot of these issues away, I'm already noticing it happen that it doesn't seem as bad as it first did, even without the corrections of the people in this room.
<Habib> For whatever reason, though, Haskell hooked me with its syntax (and of course, what people were saying about it) almost straight away. Some languages do that.
<Habib> Maybe it was just right time, right place.
two_wheels has joined #ocaml
<Leonidas> Habib: actually, you don't have to use the dotted operators. In Core you can just say Float.(1. + 2.), it redefines the operators to work on Floats.
<Leonidas> I'm a bit confused because I think OCaml and Haskell syntax are very similar, except OCaml is a bit more verbose at times
<Habib> See, I'm not sure how I feel about this Module.((* stuff in here *)) syntax, but it's definitely interesting.
<Habib> ReasonML looks like 90% JS. ReasonReact could be a good start for a colleague I have in mind who loves React.
<Leonidas> Habib: there's up and downsides to it. I think it makes sense to use in moderation.
<Habib> Yes, they are very similar. I think that's why I inevitably compare them constantly.
<Leonidas> when I was tutoring Haskell and writing OCaml for work I constantly mixed them because OCaml uses -> for pattern match and Haskell = I believe
<Habib> Haskell uses -> as well with case statements.
<Leonidas> Habib: in university we found that people were more confused by e.g. Haskells `[a]` type than OCamls `'a list`
<Habib> I can see how that would be confusing.
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
<Leonidas> the clearest would be to just have proper alpha, but OCaml is from the nineties and there is no alpha in latin1
<octachron> A side advantage of `'` compared to the greek script convention is that this makes easier to give meaningful name to type variables beyond α,β,γ ...
<ggole> Having symmetry between value and type constructors is nice
<ggole> I don't think OCaml needs as many syntaxes for application as it has
orbifx1 has quit [Ping timeout: 244 seconds]
<sagotch> Can I produce a cmxs file with dune? (like dune build foo.cmxs)
<octachron> sagotch, yes? dune build libname.cmxs should work
<sagotch> 'Don't know how to build doc/jg_highlight.cmxs'
<sagotch> Ah... It's from a .mll, maybethat is the problem
tane has joined #ocaml
two_wheels has quit [Remote host closed the connection]
orbifx1 has joined #ocaml
<sagotch> Even with the .ml, dune "Don't know how to build jg_highlight.cmxs"
<octachron> It might only work with libraries?
orbifx1 has quit [Ping timeout: 240 seconds]
jbrown has joined #ocaml
<sagotch> Okay, thanks, I needed to declare a dummy library in order to produce the cmxs. It produces more than the cmxs, but that it will be okay for my use case
jao has joined #ocaml
crowley95 has quit [Ping timeout: 244 seconds]
crowley95 has joined #ocaml
<Drup> Leonidas: regardless of that, you always need ascii version of the language constructions.
<Drup> not everyone enjoy using 15 input methods to be able to type code.
<Drup> octachron: ελτ list ?
<octachron> Drup, it is certainly better than nothing, but my reading speed for abbreviated english words transliterated to greek is limited :)
ygrek__ has quit [Ping timeout: 245 seconds]
marvin2 has joined #ocaml
<sagotch> Using dune, I need to use src/prog.exe from test/runtest alias rule, is it even possible? I trier with %{bin:src/prog.exe} but it says "not found in the tree or in PATH (context: default)"
<sagotch> (i.e. I want to use a bin from src/ in the test/dune file)
ygrek__ has joined #ocaml
<octachron> This should be possible, have you tried with a relative path "../src/prog.exe" ?
<sagotch> Hum... I was trying to use the public name, while i should use the /internal/ name...
Haudegen has quit [Remote host closed the connection]
sagotch has quit [Quit: Leaving.]
barcabuona has joined #ocaml
barcabuona has left #ocaml [#ocaml]
Habib has quit [Quit: Habib]
tane has quit [Quit: Leaving]
two_wheels has joined #ocaml
two_wheels has quit [Remote host closed the connection]
themsay has joined #ocaml
themsay has quit [Ping timeout: 252 seconds]
Guest8045 has joined #ocaml
Habib has joined #ocaml
crowley95 has quit [Ping timeout: 272 seconds]
crowley95 has joined #ocaml
sagotch has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
ygrek__ has quit [Ping timeout: 252 seconds]
asymptotically has quit [Remote host closed the connection]
asymptotically has joined #ocaml
<sagotch> Does a lexer produced by ocamllex loop on `eof` when the end of file is reached ? I turned my EOF into EOF EOF EOF EOF EOF EOF EOF EOF in the mly, and it seems that it stille parse the files as it should...
<def`> yes
oleks3 has joined #ocaml
<sagotch> Oh great, thanks
oleks3 has quit [Remote host closed the connection]
zolk3ri has quit [Ping timeout: 256 seconds]
Guest8045 has quit [Read error: Connection reset by peer]
Habib has left #ocaml [#ocaml]
zolk3ri has joined #ocaml
jnavila has joined #ocaml
ggole has quit [Quit: ggole]
asymptotically has quit [Remote host closed the connection]
asymptotically has joined #ocaml
orbifx1 has joined #ocaml
sagotch has quit [Quit: Leaving.]
ygrek__ has joined #ocaml
bjorngi10 has joined #ocaml
bjorngi10 has quit [Read error: Connection reset by peer]
al-damiri has joined #ocaml
webshinra has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
JFDkthx18 has joined #ocaml
JFDkthx18 has quit [Read error: Connection reset by peer]
orbifx1 has quit [Ping timeout: 252 seconds]
<Leonidas> Drup: APL likes to have a word with you
pierpal has quit [Ping timeout: 268 seconds]
zolk3ri has quit [Quit: Lost terminal]
eht17 has joined #ocaml
eht17 has quit [Remote host closed the connection]
kakadu has quit [Remote host closed the connection]
fraxamo has quit [Quit: Leaving]
stux|RC-- has joined #ocaml
stux|RC has quit [Ping timeout: 252 seconds]
jbrown has quit [Ping timeout: 252 seconds]
bartholin has quit [Remote host closed the connection]
ygrek__ has quit [Ping timeout: 264 seconds]
orbifx1 has joined #ocaml
rwmjones has quit [Quit: ZNC - 1.6.0 -]
rwmjones has joined #ocaml
jnavila has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 244 seconds]
jnavila has quit [Ping timeout: 246 seconds]
<companion_cube> I think it's Drup who would like to have a word with APL
asymptotically has quit [Quit: Leaving]
orbifx1 has quit [Ping timeout: 252 seconds]