Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Year of OCaml?

Name: Anonymous 2015-05-28 4:58

We have recently gotten or will be soon getting, in no particular order:

# multicore (no more GIL)
# flambda
# GC tuning for real time systems
# algebraic effects
# modular implicits

Are we kicking ass yet?

Name: Anonymous 2015-06-11 16:20

>>39
Can you give an example?

Name: Anonymous 2015-06-11 17:09

>>41
Of course not

Name: Anonymous 2015-06-11 17:38

>>42
You just realized (expr) only works on callable expressions, didn't you?

Name: Anonymous 2015-06-12 1:17

>>43
You just realized these dubs are piping hot and ready to be checked, didn't you?

Name: Anonymous 2015-06-12 13:47

>>44
No, please elaborate on what are dubs.

Name: Anonymous 2015-06-12 14:08

>>45
;; are the ultimate dubs. OCaml is the dubnguage.

Name: Anonymous 2015-06-12 20:18

>>46
You've finally convinced me. I'm learning me an OCaml.

Care to advise some learning materials for the language, anyone?

Name: Anonymous 2015-06-12 20:26

Name: Anonymous 2015-06-12 22:22

>>47
OCaml learning resources are not great...

http://ocaml.org/ - the tutorials aren't the best, but can be helpful, there are up-to-date docs here.

http://try.ocamlpro.com/ - online REPL, could be useful.

Some tips:

https://opam.ocaml.org/ - you'll want to use this. Install system OCaml and if you want to upgrade, opam switch. Use opam instead of system packages for packages. You might need system packages for a few, and you'll need the system -dev libraries for a bunch of things.

When you read about functors skip any docs/tutorials that talk about how confusing it might be. It's not a hard concept and the author is just setting you up for failure.

Don't try to understand the types in Printf, at least not at first. It's atypical and Lovecraftian.

FFI used to be a nightmare, but now you can just use ctypes.

Name: Anonymous 2015-06-13 10:50

>>48-49
Thanks.

Name: Anonymous 2015-06-13 19:18

>>50
http://www.lexicallyscoped.com/2015/06/06/intro-to-ocaml.html

It's a recent post with links to different things, including RWO which no one has mentioned yet.

Name: Anonymous 2015-06-13 19:40

>>51
I'm a software developer and team leader living in Gothenburg, Sweden.
I bet there isn't a single Swede on his team, only negroes and arabs, and he also has a cuck-shed.

Name: Anonymous 2015-06-13 22:10

I will do OCaml Q&A in this thread for learning purposes if anyone is interested.

Name: Anonymous 2015-06-13 22:51

>>53
how do you contral linking order in the C FFI?

Name: Anonymous 2015-06-13 23:25

>>54
AFAIK it's the order seen on the command line. I don't do a lot of FFI and most of it ends up being trial and error.

I have a few bookmarks:
http://caml.inria.fr/pub/docs/manual-ocaml/intfc.html
http://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.html
http://www.mega-nerd.com/erikd/Blog/CodeHacking/Ocaml/calling_ocaml.html

Most of the time you should prefer ctypes unless the overhead is too much for you:
https://github.com/ocamllabs/ocaml-ctypes
https://github.com/ocamllabs/ocaml-ctypes/wiki/ctypes-tutorial

Name: Anonymous 2015-06-13 23:34

>>55
It's like people don't even try with their dubs anymore.

Name: Anonymous 2015-06-13 23:43

>>56
I reserve my dubs for quality posts unlike you shitstains.

Name: Anonymous 2015-06-14 10:49

>>53
Is there a way to have s-exp syntax for OCaml?

Name: Anonymous 2015-06-14 11:05

>>58
Why would you want that? If the answer is metaprogramming, there are better ways to do it... and sexprs are boring when you have a type system that does lambda calculus.

Name: Anonymous 2015-06-14 11:26

>>59
Because s-exps are the superior syntax.

Name: Anonymous 2015-06-14 13:29

>>59 a.k.a haskell the autistic dog

Name: Anonymous 2015-06-14 22:55

>>60
So you're just derailing then? Ok.

Name: Anonymous 2015-06-14 22:57

>>62
No, I'm asking if there's a tool to have s-exp syntax in OCaml. Cause otherwise I'd have to write it myself. There isn't, then?

Name: Anonymous 2015-06-14 23:03

>>63
otherwise I'd have to write it myself

why?

just use normal ocaml syntax

Name: Anonymous 2015-06-14 23:10

>>64
It gives me pain. It's too angular, unbalanced, haphazard and complex. After I tried Lisp, all other syntaxes are not good enough for me. And since Ocaml seems moderately hard to parse, I imagined that someone already did the work. Alas, I'll have to do it myself. Thanks for your (implicit) answer, negative though it may be.

Name: Anonymous 2015-06-14 23:20

>>63
There's a library for inline sexpr data representation. Nobody would want to write OCaml code in sexprs. If you think otherwise, I submit you don't really want to write OCaml.

Name: Anonymous 2015-06-14 23:21

Name: Anonymous 2015-06-14 23:29

>>67
Thanks anon!

>>66
Why so sure? Check this out:

(value x 42)
(value f (lambda x 0))
(value rec f (lambda (x y) 0))
(let ((x 42) (y 27)) (+ x y))
(let* ((x 42) (y 27)) (+ x y))
(module M (struct ...))
(type (t 'a) (sum (A 'a int) (B)))
(lambda (x y) x)
(progn x y z)
(f x y)
(list 1 2 3)
(list x y z :: t)
(, a b c)
(match x ((range 'A' 'Z') "x")))
({} (x y) (z t))

Name: Anonymous 2015-06-14 23:29

you'll cowards don't even smoke camels

Name: Anonymous 2015-06-14 23:46

>>68
I'm not sure that even exists anymore or ever covered much of the language.

Name: Anonymous 2015-06-14 23:56

Name: Anonymous 2015-06-15 0:29

>>71
Funny it's not in my p5 distribution. Anyway, that reads a lot worse than both Lisp and OCaml.

Name: Anonymous 2015-06-15 1:35

>>72
your moms an ocaml

Name: Anonymous 2015-06-15 7:02

>>68
It's...it's beautiful!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List