copy` has quit [Quit: Connection closed for inactivity]
darkf has joined #ocaml
walter|r has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
walter|r has quit [Ping timeout: 244 seconds]
michbad has joined #ocaml
tennix has joined #ocaml
pierpa has quit [Ping timeout: 250 seconds]
agarwal1975 has joined #ocaml
tennix has quit [Quit: WeeChat 1.5]
pyon has quit [Quit: ... flowering silent scarlet piece of night.]
nicholasf has quit [Remote host closed the connection]
Algebr` has joined #ocaml
troydm has quit [Ping timeout: 244 seconds]
<def`>
sh0t: I can help
<def`>
what's the problem?
troydm has joined #ocaml
yunxing_ has joined #ocaml
nicholasf has joined #ocaml
troydm has quit [Ping timeout: 244 seconds]
yunxing_ has quit [Quit: Leaving...]
nicholasf has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
sh0t has quit [Remote host closed the connection]
johnelse has quit [Ping timeout: 272 seconds]
johnelse has joined #ocaml
regnat has quit [Ping timeout: 276 seconds]
tg has quit [Quit: Leaving]
tg has joined #ocaml
johnelse has quit [Ping timeout: 276 seconds]
johnelse has joined #ocaml
yunxing_ has joined #ocaml
yunxing_ has quit [Client Quit]
johnelse has quit [Ping timeout: 264 seconds]
regnat has joined #ocaml
johnelse has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
pyon has joined #ocaml
FreeBirdLjj has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
A1977494 has joined #ocaml
slash^ has joined #ocaml
f[x] has joined #ocaml
MercurialAlchemi has joined #ocaml
shim has quit [Ping timeout: 264 seconds]
michbad has quit [Ping timeout: 246 seconds]
michbad has joined #ocaml
f[x] has quit [Ping timeout: 260 seconds]
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 276 seconds]
michbad has quit [Remote host closed the connection]
technomancy has joined #ocaml
<technomancy>
I'm looking for a static (hopefully ML-like) language that is easy to embed in a larger program the way Lua is. any suggestions?
<def`>
OCaml :p?
<technomancy>
I get the impression that OCaml is really difficult to embed in a C program, but maybe that's not correct?
<technomancy>
I should add that I will need to compile code at runtime, since the application in question is a programming-centric game.
<technomancy>
and sadly most of my users are on Windows
<def`>
All requirements look fine to me
<def`>
OCaml is easy to embed, I don't know what gave you this impression.
<def`>
Compiling code at runtime is fine too, with different tradeoff.
<technomancy>
well, when I've written my own ocaml programs, the toolchain has always felt very complicated, with loads of moving parts compared to lua
<def`>
So I should say it this way: the runtime is easy to embed
<def`>
the compiler is a bit harder to work with :-)
AlexDenisov has joined #ocaml
<def`>
So it require some discipline to work with. But it is possible to get a straightforward workflow.
<technomancy>
right... I was looking at https://jesserayadkins.github.io/lily/ which looks a lot easier to embed and compile (basically only one dependency) but its inference isn't very good
<technomancy>
I don't care at all about performance or libraries in this case
<technomancy>
so a "toy" type language is fine
<def`>
I see. I don't really know what to suggest... What about embedding a JS engine and using a language that compile to JS?
<def`>
typed*
<technomancy>
hm; hadn't thought about that
tg has quit [Quit: Leaving]
<technomancy>
I feel like the typescript toolchain is pretty baroque too though
TheLemonMan has joined #ocaml
tg has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
malc_ has joined #ocaml
<def`>
technomancy: what about flow?
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 258 seconds]
<adrien>
cmxs files can do the trick
<adrien>
lexifi does this
fluter has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
fluter has joined #ocaml
A19774941 has quit [Quit: Leaving.]
octachron has joined #ocaml
freehck has quit [Ping timeout: 260 seconds]
<technomancy>
def`: huh, is flow basically dialyzer for JS?
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
tg has quit [Quit: Leaving]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
tg has joined #ocaml
mrallen1 has joined #ocaml
sdothum has joined #ocaml
stephe_ has joined #ocaml
sepp2k has joined #ocaml
mankyKitty has joined #ocaml
jeroud has joined #ocaml
tane has joined #ocaml
Simn has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
tane has quit [Quit: Verlassend]
tane has joined #ocaml
troydm has joined #ocaml
nicholasf has joined #ocaml
rand__ has joined #ocaml
<def`>
technomancy: it's a type system for JS yes
nicholasf has quit [Ping timeout: 264 seconds]
<mrvn>
can ocmal be run in-place or does it need make install?
<fds>
I'm pretty sure I used to run it in-place before I used opam.
<mrvn>
bin/ocaml
<mrvn>
Fatal error: unknown C primitive `caml_add_debug_info'
<octachron>
mrvn, it might be nice to extend the tests in testsuite/tests/lib-bigarray/bigarrays.ml in order to exercice the int_least31 bigarray format
dhil has joined #ocaml
<gasche>
mrvn, Drup: "make runtop"
<gasche>
(cc fds)
FreeBirdLjj has joined #ocaml
A1977494 has joined #ocaml
<gasche>
(this command was not available "years ago", but running the toplevel without installing always worked with the right invocation)
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
<Drup>
gasche: hum, how recent is that one ?
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
<gasche>
December 10, 2015
<adrien>
mrvn: in-place, with -nostdlib, and -I
<gasche>
"make runtop"
<mrvn>
gasche: thx
loocash has joined #ocaml
dhil has quit [Ping timeout: 252 seconds]
shim has joined #ocaml
<loocash>
Hi guys, I was recently playing with ocaml and I solved this problem (https://projecteuler.net/problem=21) in both OCaml (http://pastebin.com/PgBK0HMM) and JS (http://pastebin.com/zj0JygjG). In my computer interpreted JS runs faster than compiled (corebuild solution.native) ocaml code. Is that what it supposed to be or it's just something wrong with my ocaml code?
<mrvn>
ocaml doesn't optimize and you create a lot of lists in the ocaml code
<mrvn>
loocash: why is 1 a divisior of n but n is not?
<loocash>
"proper" divisor
<loocash>
it is in problem definition
<mrvn>
odd definition
<loocash>
so how can i make this code run faster?
<loocash>
how to create fewer lists?
<TheLemonMan>
replace the pipelines with imperative for loops maybe ?
<mrvn>
Don't use List.range, use a recursion
<mrvn>
Also I would first compute the sum of proper divisors for all numbers into an array. Then go through the array and add up the amicable numbers.
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
<mrvn>
and don't do the test cases when timing.
nicholasf has quit [Remote host closed the connection]
<mrvn>
it could also help to make some lists of potential divisors or branch in the code. For example if n is odd then you can skip all even numbers.
<mrvn>
or find the prime factors and then compute the proper divisors from that.
<loocash>
Yes I could implement more efficient algorithm but I wanted to compare it with its equivalent int JS.
<loocash>
ok thanks for advices I will try some of them and tell if something interesting happens
<mrvn>
That's why I started with the list thing. I think the js code doesn't create the lists
nicholasf has joined #ocaml
<mrvn>
or rather just a list of divisors and not a list of all numbers < n/2+1
<mrvn>
have you tried running the ocaml code through js_of_ocaml?
<loocash>
no should I?
<gasche>
loocash: how do you run your JS code?
<loocash>
gasche: from node
<loocash>
with
<gasche>
it's not "interpeted", then
<gasche>
(even with the missing "r")
technomancy has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
<loocash>
gasche: I didn't know that. It makes a difference. THanks
<gasche>
you could try using Core.Sequence instead of Core.List, it doesn't build lists in memory
<gasche>
(I suppose Javascript's .filter operation also returns a generator instead of a full list)
<gasche>
just replacing all "List" in your code by "Sequence" may work
<gasche>
(of course you can also use a direct recursion, or a loop, but this allows to keep the pipelined style)
<gasche>
hm
<gasche>
in fact it looks like underscore's "range" method really returns a result array, so I'd guess that's just a case of v8's JS compiler beating the OCaml compiler (also arrays, used in the JS version, may have better locality than lists)
<gasche>
(one should also try with Array to compare, I guess)
nicholasf has quit [Remote host closed the connection]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
pdewacht has joined #ocaml
<mrvn>
how short is that test anyway? <1s?
<loocash>
In my cpu (core2duo 2.1 GHz) with List replaced by Sequence it takes 1.5s now
<loocash>
Js takes 1.9s
<loocash>
before it was 3.7s with List
<loocash>
So Sequence did the trick
<mrvn>
should test up to 100000
<gasche>
what about Array?
octachron has quit [Ping timeout: 276 seconds]
<gasche>
(which would be closer to the underscore implementation, if I understand correctly)
<mrvn>
gasche: how do you filter an array down to its divisors?
<gasche>
well I suppose Core.Array implements a filter method
<gasche>
(I don't know how some people can do software development without tests)
<gasche>
I think we should even go further and have a mode of development that implies writing documentation
<gasche>
(I found it efficient to root out design mistakes)
AlexDenisov has quit [Max SendQ exceeded]
AlexDenisov has joined #ocaml
<malc_>
gasche: reinventing literate programming are we? ;)
<octachron>
gasche, I fear that that documentation depends more on developpers than on models of developpement; except if you have a strong IA that can check that the documentation is meaningful.
<mrvn>
Idealy I would like code, interfaces, tests and docs in a single file.
rgrinberg has quit [Ping timeout: 258 seconds]
<companion_cube>
things like doctest are nice, though
<companion_cube>
docs containing code that was to compile and yield the expected result
<octachron>
companion_cube, any example for ocaml?
<companion_cube>
not really
<companion_cube>
I know those from python, mostly
<companion_cube>
(well, with qtest you can write tests in the .mli as comments, but well)
AlexRussia has joined #ocaml
dakk has joined #ocaml
SpiceGuid has joined #ocaml
SpiceGuid has quit [Client Quit]
SpiceGuid has joined #ocaml
AlexDenisov has quit [Ping timeout: 240 seconds]
AlexDeni_ has joined #ocaml
fleaswallow has joined #ocaml
pyon has quit [Quit: Know your place, 3D woman!]
nicholasf has joined #ocaml
rgrinberg has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rand__ has quit [Quit: leaving]
slash^ has quit [Read error: Connection reset by peer]
nicholasf has quit [Remote host closed the connection]
octachron has quit [Quit: Leaving]
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 240 seconds]
melanargia1 has joined #ocaml
melanargia1 has quit [Quit: WeeChat 1.5]
melanargia1 has joined #ocaml
melanargia1 has quit [Client Quit]
melanargia1 has joined #ocaml
melanargia1 has quit [Client Quit]
melanargia1 has joined #ocaml
AlexDenisov has joined #ocaml
AlexDeni_ has quit [Ping timeout: 240 seconds]
AlexDenisov has quit [Ping timeout: 252 seconds]
AlexDenisov has joined #ocaml
melanargia1 has quit [Quit: WeeChat 1.5]
Kakadu has joined #ocaml
melanargia1 has joined #ocaml
melanargia1 has quit [Client Quit]
melanargia1 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
melanargia1 has quit [Quit: WeeChat 1.5]
Sorella has quit [Quit: Connection closed for inactivity]
sepp2k has joined #ocaml
pierpa has joined #ocaml
dakk has quit [Ping timeout: 258 seconds]
malc_ has quit [Ping timeout: 252 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
walter|r has joined #ocaml
dakk has joined #ocaml
walter|r has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
nicholasf has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
Kakadu has quit [Remote host closed the connection]
nicholasf has quit [Remote host closed the connection]
shinnya has joined #ocaml
nicholasf has joined #ocaml
fleaswallow has quit [Quit: Leaving]
f[x] has quit [Ping timeout: 276 seconds]
dhil has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Leaving]
walter|r has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
SpiceGuid has quit [Ping timeout: 272 seconds]
abeaumont has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 276 seconds]
A19774941 has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
bruce_r has joined #ocaml
<bruce_r>
Seliopou you here? I saw you tried to talk to me
<bruce_r>
I tried to contact you through your website or github account but I couldn't find anything to contact you.