adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
ed-ilyin-lv has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
iitalics has joined #ocaml
FreeBirdLjj has joined #ocaml
infinity0 has joined #ocaml
dtornabene has joined #ocaml
infinity0 has quit [Remote host closed the connection]
ed-ilyin-lv has joined #ocaml
sgronblo has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 246 seconds]
segmond has joined #ocaml
infinity0 has joined #ocaml
tautologico has quit [Quit: Connection closed for inactivity]
louisriesener has quit [Ping timeout: 240 seconds]
keep_learning has quit [Ping timeout: 240 seconds]
jlam_ has joined #ocaml
jlam is now known as Guest98597
Guest98597 has quit [Killed (cherryh.freenode.net (Nickname regained by services))]
jlam_ is now known as jlam
ousado has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
ousado has joined #ocaml
sgronblo has quit [Read error: No route to host]
sgronblo_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
iitalics has quit [Ping timeout: 268 seconds]
copy` has quit [Quit: Connection closed for inactivity]
tautologico has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
mfp has quit [Ping timeout: 246 seconds]
segmond has quit [Quit: l8r]
iitalics has joined #ocaml
dtornabene has quit [Remote host closed the connection]
hashpuppy has quit [Quit: Connection closed for inactivity]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
mengu has quit [Remote host closed the connection]
iitalics has quit [Quit: /thread]
yegods has quit [Remote host closed the connection]
sgronblo_ has quit [Ping timeout: 246 seconds]
jfntn has joined #ocaml
sgronblo has joined #ocaml
sgronblo has quit [Remote host closed the connection]
sgronblo has joined #ocaml
diphuser has joined #ocaml
sgronblo has quit [Ping timeout: 260 seconds]
sgronblo has joined #ocaml
sgronblo has quit [Ping timeout: 260 seconds]
sgronblo has joined #ocaml
jao has quit [Ping timeout: 268 seconds]
sgronblo has quit [Ping timeout: 268 seconds]
sgronblo has joined #ocaml
sgronblo has quit [Ping timeout: 255 seconds]
sgronblo has joined #ocaml
alexelcu has quit [Remote host closed the connection]
alexelcu has joined #ocaml
dtornabene has joined #ocaml
segmond has joined #ocaml
pierpa has quit [Quit: Page closed]
sgronblo_ has joined #ocaml
sgronblo has quit [Ping timeout: 260 seconds]
segmond has quit [Quit: l8r]
MercurialAlchemi has joined #ocaml
vgrocha has quit [Ping timeout: 255 seconds]
mks11 has joined #ocaml
jfntn has quit [Ping timeout: 246 seconds]
trasz_ has joined #ocaml
trasz has quit [Ping timeout: 246 seconds]
mks11 has quit [Ping timeout: 260 seconds]
seliopou has quit [Ping timeout: 240 seconds]
seliopou has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Ping timeout: 268 seconds]
jack5638 has joined #ocaml
jfntn has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
dtornabene has quit [Ping timeout: 240 seconds]
jfntn has quit [Ping timeout: 260 seconds]
mars0i has joined #ocaml
mars0i has quit [Client Quit]
freusque has joined #ocaml
freusque has quit [Client Quit]
MercurialAlchemi has joined #ocaml
freusque has joined #ocaml
olibjerd has joined #ocaml
orbitz has quit [Read error: Connection reset by peer]
orbitz has joined #ocaml
raphinou has joined #ocaml
raphinou has quit [Ping timeout: 246 seconds]
raphinou has joined #ocaml
dtornabene has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
alfredo has joined #ocaml
dtornabene has quit [Client Quit]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jfntn has joined #ocaml
jfntn has quit [Ping timeout: 245 seconds]
Simn has joined #ocaml
raphinou has quit [Ping timeout: 240 seconds]
AlexRussia has quit [Ping timeout: 258 seconds]
johnelse_ has joined #ocaml
AlexRussia has joined #ocaml
johnelse has quit [Ping timeout: 260 seconds]
raphinou has joined #ocaml
alexelcu has quit [Remote host closed the connection]
alexelcu has joined #ocaml
AlexDenisov has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
trasz_ is now known as trasz
adrien is now known as SpecialSnowflake
trasz has quit [Changing host]
trasz has joined #ocaml
jack5638 has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
jfntn has joined #ocaml
zpe has joined #ocaml
jfntn has quit [Ping timeout: 268 seconds]
freusque has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
srenatus[m] has quit [Remote host closed the connection]
M-Illandan has quit [Remote host closed the connection]
M-martinklepsch has quit [Remote host closed the connection]
ktosiek[m] has quit [Read error: Connection reset by peer]
regnat[m] has quit [Read error: Connection reset by peer]
timclassic has quit [Remote host closed the connection]
hpd_m has quit [Remote host closed the connection]
tcc[m] has quit [Read error: Connection reset by peer]
isaachodes[m] has quit [Read error: Connection reset by peer]
M-jimt has quit [Remote host closed the connection]
smondet[m] has quit [Remote host closed the connection]
aspiwack[m] has quit [Remote host closed the connection]
yetanotherion[m] has quit [Read error: Connection reset by peer]
Bluddy[m] has quit [Remote host closed the connection]
mars0i[m] has quit [Read error: Connection reset by peer]
orbifx[m] has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
yetanotherion[m] has joined #ocaml
gregoire has quit [Ping timeout: 260 seconds]
M-jimt has joined #ocaml
srenatus[m] has joined #ocaml
M-martinklepsch has joined #ocaml
M-Illandan has joined #ocaml
smondet[m] has joined #ocaml
timclassic has joined #ocaml
hpd_m has joined #ocaml
orbifx[m] has joined #ocaml
ktosiek[m] has joined #ocaml
Bluddy[m] has joined #ocaml
mars0i[m] has joined #ocaml
regnat[m] has joined #ocaml
isaachodes[m] has joined #ocaml
aspiwack[m] has joined #ocaml
tcc[m] has joined #ocaml
gregoire has joined #ocaml
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
zpe has joined #ocaml
Algebr has joined #ocaml
jfntn has joined #ocaml
sfri has quit [Remote host closed the connection]
freusque has quit [Quit: WeeChat 1.7]
jfntn has quit [Ping timeout: 240 seconds]
diphuser has quit [Ping timeout: 246 seconds]
govg has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
kakadu has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
sgronblo_ has quit [Ping timeout: 240 seconds]
mengu has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
mfp has joined #ocaml
mengu has joined #ocaml
johnelse_ has quit [Ping timeout: 260 seconds]
johnelse has joined #ocaml
evilkidder has joined #ocaml
jfntn has joined #ocaml
evilkidder has quit [Ping timeout: 260 seconds]
jfntn has quit [Ping timeout: 268 seconds]
govg has quit [Ping timeout: 246 seconds]
AlexDenisov has joined #ocaml
sz0 has joined #ocaml
ziyourenxiang has joined #ocaml
govg has joined #ocaml
johnelse_ has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
freusque has joined #ocaml
_andre has joined #ocaml
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Quit: Leaving...]
olibjerd has quit [Quit: olibjerd]
srenatus[m] has quit [Remote host closed the connection]
M-Illandan has quit [Remote host closed the connection]
ktosiek[m] has quit [Remote host closed the connection]
smondet[m] has quit [Remote host closed the connection]
Bluddy[m] has quit [Remote host closed the connection]
M-jimt has quit [Read error: Connection reset by peer]
hpd_m has quit [Remote host closed the connection]
aspiwack[m] has quit [Remote host closed the connection]
yetanotherion[m] has quit [Remote host closed the connection]
mars0i[m] has quit [Remote host closed the connection]
M-martinklepsch has quit [Remote host closed the connection]
tcc[m] has quit [Remote host closed the connection]
isaachodes[m] has quit [Read error: Connection reset by peer]
orbifx[m] has quit [Read error: Connection reset by peer]
timclassic has quit [Read error: Connection reset by peer]
regnat[m] has quit [Read error: Connection reset by peer]
lukky513 has quit [Ping timeout: 240 seconds]
gregoire has quit [Ping timeout: 260 seconds]
clockish has quit [Ping timeout: 260 seconds]
noplamodo has quit [Ping timeout: 260 seconds]
M-jimt has joined #ocaml
noplamodo has joined #ocaml
clockish has joined #ocaml
jfntn has joined #ocaml
smondet[m] has joined #ocaml
M-Illandan has joined #ocaml
M-martinklepsch has joined #ocaml
timclassic has joined #ocaml
srenatus[m] has joined #ocaml
ktosiek[m] has joined #ocaml
hpd_m has joined #ocaml
Bluddy[m] has joined #ocaml
orbifx[m] has joined #ocaml
tcc[m] has joined #ocaml
yetanotherion[m] has joined #ocaml
isaachodes[m] has joined #ocaml
regnat[m] has joined #ocaml
mars0i[m] has joined #ocaml
aspiwack[m] has joined #ocaml
gregoire has joined #ocaml
spew has joined #ocaml
lukky513 has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
olibjerd has joined #ocaml
vgrocha has joined #ocaml
cool88 has joined #ocaml
<cool88> hi, I wrote my reverse a list version.. which is pretty slow. I am curious what would one need to do (in OCAML) to make it better? I do not want to use the lib function because I'm pretty sure I'll run into another function that I won't have library for. Are there certain ways that I can think in?
<companion_cube> not sure I follow, what is wrong with List.rev?
raphinou has quit [Quit: WeeChat 1.6]
<cool88> companion_cube: thanks! nothing wrong with it. I am learning OCaml, so I want to know how to write it efficiently myself too.
<companion_cube> may I see your implementation?
<cool88> let rec rev (xs: 'a list) : 'a list = match xs with |[] -> [] |x::xs' -> rev xs' @ [x]
<companion_cube> ah, I see
<cool88> companion_cube: let rec rev (xs: 'a list) : 'a list = match xs with |[] -> [] |x::xs' -> rev xs' @ [x]
<companion_cube> this is very inefficient, indeed, because it has quadratic complexity in the length of the list
<cool88> companion_cube: thanks so much for looking into it.
<companion_cube> if you look at the stdlib's List.rev, it is defined via List.rev_append
<companion_cube> List.rev_append l1 l2 = match l1 with [] -> l2 | x :: l1' -> rev_append l1' (x::l2)
<octachron> cool88, as a general rule, "list @ [x]" is a sign of potential problems
<companion_cube> ^
<cool88> Ah I see!
<cool88> It's sometimes hard to see the complexity here .. (I remember when I do this in python, I know two loops is a bad sign).
<companion_cube> and @ contains a loop :-)
alfredo has quit [Ping timeout: 240 seconds]
<cool88> companion_cube: AH! ok! thanks a bunch
<octachron> cool88, (@) is left-oriented: the complexity of (left @ right) is (lenght left), so (@) should generally used as (small_list @ big_list) if possible
<companion_cube> exactly
<cool88> octachron: got it!
<cool88> companion_cube: thank you for the append version. :)
<companion_cube> as a consequence, List.rev is linear
spew has quit [Ping timeout: 246 seconds]
spew has joined #ocaml
<Leonidas> does anyone know how to set environment variables in omake?
govg has quit [Ping timeout: 272 seconds]
<companion_cube> omake is so pré-jbuilder :D
govg has joined #ocaml
jfntn has quit [Ping timeout: 272 seconds]
cool88 has quit [Ping timeout: 260 seconds]
cool88 has joined #ocaml
ciniglio has joined #ocaml
<cool88> companion_cube: next question .. how would I append to a list? :/ (without the stdlib). Nothing so far I have learned with match etc seem to help here. should I use for loop?
govg has quit [Ping timeout: 240 seconds]
<companion_cube> no, recursion + match, always
spew has quit [Ping timeout: 268 seconds]
<companion_cube> (on lists)
<companion_cube> are you doing homework?
<cool88> companion_cube: Ok.. I'll think harder. I am following the book Ocaml from the very beginning
<companion_cube> oh, I see
<cool88> companion_cube: and some Youtube videos
<cool88> companion_cube: cs51 from harvard seems nice so far
ciniglio has quit [Remote host closed the connection]
AlexRussia has quit [Ping timeout: 240 seconds]
<cool88> companion_cube: thanks for saving my trust in recursion.. wrote this let rec append (xs: 'a list) (el: 'a) : 'a list = match xs with |[] -> [el] |x::xs' -> x::(append xs' el)
spew has joined #ocaml
<cool88> companion_cube: I really hope that people here do not mind me asking these question. I'll try to help out other beginners in the future.
<cool88> companion_cube: or maybe write a post..after I am done through basics.
pierpa has joined #ocaml
<hannes> cool88: keep in mind your append is not tail-recursive (if this is of concern.. not sure where/when in OCaml from the very beginning tail-recursion is handled)
<companion_cube> it's fine to ask questions :)
<Leonidas> companion_cube: I do plan to migrate to jbuilder :)
<cool88> hannes: ah! thanks! I'll look up the term.. it has been discussed yet or maybe I dismissed it as something not imp. Thanks so much for brining this up.
<cool88> hannes: *not
govg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 272 seconds]
freusque has joined #ocaml
cool88 has quit [Quit: Page closed]
shinnya has joined #ocaml
jadrian has joined #ocaml
<jadrian> I'm probably missing something very obvious here
<jadrian> installed opam... now how do I get ocaml? there seems to be no ocaml package
<jadrian> utop is there, and tuareg, and all sorts of ocaml tools... but I don't see ocaml itself anywhere
<tobast> jadrian: opam switch [ocaml version] ?
<Drup> jadrian: which opam version are you using ?
<tobast> well, you should already have an ocaml version installed somewhere if installing all that worked
<jadrian> tobast: thought so, but `which ocaml` returns nothing (ok so maybe the binary is somewhere not in $PATH, but where?) and there is no ocaml in the packages dir
<tobast> AH, yeah
<jadrian> Drup: 1.2.2, the latest just installed it
<tobast> you have to source the right things
<tobast> which opam > /dev/null 2>&1 && [ -d ~/.opam ] && eval `opam config env`
<jadrian> tobast: oh found it
<tobast> works for me, in your bashrc
<jadrian> .opam/4.02.1/bin
<jadrian> I had gotten lost in .opam/compilers
<tobast> jadrian: you probably want to eval $(opam config env) though
<tobast> and preferably add it to your {bash,zsh,whatever}rc
AlexRussia has joined #ocaml
<jadrian> tobast: I thought that may had been added to my .profile but no, I meant to check and forgot
sh0t has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
yegods has joined #ocaml
copy` has joined #ocaml
jabroney has joined #ocaml
sgronblo has joined #ocaml
nahra has quit [Remote host closed the connection]
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
yomimono has joined #ocaml
FreeBirdLjj has joined #ocaml
AlexRussia_ has joined #ocaml
AlexRussia has quit [Ping timeout: 258 seconds]
Algebr has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
fraggle-boate has joined #ocaml
spew has joined #ocaml
<Leonidas> jadrian: In opam 2 it will get easier, since the compiler will also be just a package.
<Leonidas> if I remember the opam 2 changes correctly, at least
jao has joined #ocaml
FreeBirdLjj has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
jlam_ has joined #ocaml
MercurialAlchemi has joined #ocaml
spew has quit [Ping timeout: 272 seconds]
spew has joined #ocaml
jlam__ has joined #ocaml
jlam_ has quit [Ping timeout: 258 seconds]
jlam_ has joined #ocaml
jlam__ has quit [Ping timeout: 258 seconds]
jlam has quit [Ping timeout: 240 seconds]
AlexRussia_ has quit [Ping timeout: 255 seconds]
silver has joined #ocaml
jlam has joined #ocaml
jlam__ has joined #ocaml
seriedivergente has joined #ocaml
jlam_ has quit [Ping timeout: 240 seconds]
seriedivergente has left #ocaml [#ocaml]
sepp2k has joined #ocaml
jadrian has quit [Ping timeout: 258 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spew has quit [Ping timeout: 246 seconds]
jabroney has quit [Quit: Leaving.]
shinnya has quit [Ping timeout: 258 seconds]
jadrian has joined #ocaml
govg has quit [Remote host closed the connection]
govg has joined #ocaml
pierpa has quit [Remote host closed the connection]
pierpa has joined #ocaml
jlam__ has quit [Ping timeout: 268 seconds]
jlam_ has joined #ocaml
<jadrian> Leonidas: that's what I expected, but I think it could be slightly better even without that
AlexRussia_ has joined #ocaml
spew has joined #ocaml
jabroney has joined #ocaml
jadrian has quit [Quit: Konversation terminated!]
sgronblo has quit [Ping timeout: 246 seconds]
larhat has joined #ocaml
<Leonidas> smondet[m]: thanks, that was helpful :)
aconz2 has joined #ocaml
jnavila has joined #ocaml
spew has quit [Ping timeout: 245 seconds]
<Leonidas> Error: Files /home/leonidas/.opam/4.04.1-decomposer/lib/Core/core.cmxa and /home/leonidas/.opam/4.04.1-decomposer/lib/Core/core.cmxa both define a module named Core
<Leonidas> are you f' kidding me jbuilder?
yomimono has quit [Ping timeout: 240 seconds]
<def`_> :D
<def`_> for some reason, something is passing core twice... what is your buildfile?
jnavila has quit [Ping timeout: 240 seconds]
nahra has joined #ocaml
jnavila has joined #ocaml
<kakadu> Folks, Will it be weird to inherit from a class a _class_type_? My idea is to specify virtual methods in a class without copypasting. Can Ocaml do that?
<kakadu> OCaml*
<flux> I don't think you can inherit from class types.
<flux> well, object types I guess.
<kakadu> Will it be sane to want the thing that I want?
<flux> or can you.. it's been time since I've used them :) (or sadly ocaml for that matter)
fraggle_ has quit [Read error: Connection reset by peer]
aggelos_ has quit [Ping timeout: 240 seconds]
aggelos_ has joined #ocaml
<octachron> kakadu, I am not sure I follow you: if you want to inherit virtual methods inheriting from a virtual class should work?
<kakadu> I want to inherit virutal methods from class type that has them
<kakadu> something like object (self) constraint self : #my_class_type end
<kakadu> In a fiction syntax of course
jnavila has quit [Ping timeout: 246 seconds]
olibjerd has quit [Quit: olibjerd]
<octachron> kakadu, this is essentially valid OCaml code: at least "class virtual c = object(self:'self) constraint 'self = #class_type end" is valid
<kakadu> It's so cool
<Leonidas> def`_: I had core and core_bench, once I removed core it worked. Though I think it shouldn't fail when a transitive dependency and a direct dependency appear in the same build
<Leonidas> (in fact I had Core and Core_bench, not sure whether the uppercasing makes a difference)
olibjerd has joined #ocaml
fraggle_ has joined #ocaml
toolslive has joined #ocaml
olibjerd has quit [Quit: olibjerd]
TheLemonMan has joined #ocaml
<Leonidas> That said, I really enjoyed using Core_bench, it is a very neat library
<companion_cube> you can give a try to `benchmark` if core_bench fails to install
aconz2 has quit [Ping timeout: 240 seconds]
<Leonidas> no, I won the competition for the fastest implementation already :p
<companion_cube> :D
<companion_cube> faster implementation of what?
kakadu has quit [Quit: Konversation terminated!]
<Leonidas> oh, we were arguing internally on an implementation of some string templating/formatting, just small stuff (that's why I thought to give core_bench a try, since writing the microbenchmark was easy and I wanted to benefit from some hopefully sane reporting)
<Leonidas> is there a way to build a format6 type somehow?
cool88 has joined #ocaml
<Leonidas> oh, format_of_string
<Leonidas> oh no, that only moves the problem around
<flux> :)
spew has joined #ocaml
spew has quit [Ping timeout: 255 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
olibjerd has joined #ocaml
spew has joined #ocaml
stux|RC has quit [Ping timeout: 255 seconds]
Simn has quit [Ping timeout: 240 seconds]
spew has quit [Ping timeout: 240 seconds]
chatter29 has joined #ocaml
<chatter29> hey guys
<chatter29> allah is doing
<chatter29> sun is not doing allah is doing
<chatter29> to accept Islam say that i bear witness that there is no deity worthy of worship except Allah and Muhammad peace be upon him is his slave and messenger
chatter29 has quit [Client Quit]
<SpecialSnowflake> 2017 and people still spam on IRC and still advertise other networks too
<SpecialSnowflake> and 2017 and they still can't grammar properly
slash^ has joined #ocaml
yomimono has joined #ocaml
<tobast> Seriously, this guy has been doing that for ages.
<flux> it's only recently I've seen it. somehow just a few days prior someone mentioned it on IRCNet. so I guess he has picked up the pace recently.
<tobast> I don’t know, they do that on a few chans I’m on as well
<flux> good thing the pattern holds, so an ignore script should be straight-forward..
<tobast> And I’ve seen them (always using `chatter29` as a nick) for a long time now.
<tobast> Yeah, but why bother. Where can we report that to the ircops?
larhat has quit [Quit: Leaving.]
<flux> I somehow doubt that would be effective. surely he would just change the host?
kakadu has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
larhat has joined #ocaml
<barcabuona> guys how can i check what a function matches to? like to get one of its curried arguments
slash^ has quit [Remote host closed the connection]
barcabuona has quit [Quit: WeeChat 1.8]
barcabuona has joined #ocaml
<barcabuona> guys how can i check what a function matches to? like to get one of its curried arguments
TheLemon1an has joined #ocaml
cool88 has quit [Quit: Page closed]
Simn has joined #ocaml
TheLemonMan has quit [Ping timeout: 268 seconds]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
TheLemonMan has joined #ocaml
<tobast> flux: they’ve been doing that for ages with the same nick
<tobast> I doubt they would change :D
TheLemon1an has quit [Ping timeout: 246 seconds]
TheLemon1an has joined #ocaml
TheLemonMan has quit [Ping timeout: 260 seconds]
Algebr has joined #ocaml
TheLemon1an has quit [Remote host closed the connection]
aconz2 has joined #ocaml
spew has joined #ocaml
<Leonidas> barcabuona: what do you mean by "maches to"?
<barcabuona> Leonidas: so yesterday it was suggested to me that i should represent function with a data structure for efficiency.
<barcabuona> and i said that i would lose the benefit of a clean typing on my function
<barcabuona> and it was said that i should implement a find data function that would implement my typing
<barcabuona> so i realized it would be the most natural way to do that on my mutable memory since it is mutable i should use an awway
<barcabuona> so now i have of course an array hidden behind a function
<barcabuona> something like find array ... of type index -> value
acierto has joined #ocaml
<barcabuona> that i beacuse i must retain the typing for my interpreter
<barcabuona> but now if i want to Array.set im at a loss. because my real array is inside the find array function
<barcabuona> so i need a way to match it out of the function, if that is even possible
<acierto> Hi guys! I'm new to OCaml, and I'm trying to use OASIS as my build tool, and I'm completely confused how can I include Str module to my project or OASISString
<companion_cube> BuildDepends: str
<companion_cube> ^ add this to the relevant entry in _oasis
<Leonidas> barcabuona: I think it is easier to understand if you post your code somewhere
<Leonidas> or better yet: don't use Str
<companion_cube> one thing at a time, Leonidas ;-)
* Leonidas :)
<acierto> I want first to understand how to include modules properly in OASIS, I already read that Str by some reason is not good, but all tutorials give example with it :)
yegods has quit [Remote host closed the connection]
<barcabuona> Leonidas: https://ptpb.pw/_8nu
<barcabuona> v is actually mv in that code whoop
<acierto> I have in my _oasis, only one entry - Executable, which points to single ml file, I added there BuildDepends: str, but I still see "Reference to undefined global `Str'"
<barcabuona> see yesterday everybody was going on about how i should use a different structure etcetera and i didnt want to because i didn't need it. but i realize a mutable memory needs to be truly mutable, so i need some array. but at the same time you can see a store type is of loc->mvalue and that is it. it's a function. so to make an array into a function i just partially apply a search function. but then if i want to
<barcabuona> edit that "function" what then?
<barcabuona> i could just reimplement an editor function like i did earlier but that'd be kinda stupid on a mutable array. sorry for long text im verbose
spew has quit [Ping timeout: 240 seconds]
<Leonidas> for mutable memory you do not need an array
<Leonidas> I still don't really understand what you really want to do. All that code seems to be doing… not much in a rather complicated way.
<octachron> barcabuona, partially applying a search function loses information (or memory) , so you want to keep your memory separated and uses the find function only when needed
<octachron> barcabuona, and for information, the data structure that you want to use is an hash table, not an array
<barcabuona> octachron: my interpreter is passed a type store = loc->value
<barcabuona> how am i supposed to keep that type alive if i keep my store mem separate?
<barcabuona> i would have to change the signature of my interpreter
<barcabuona> but that fucks everything up in all my formulas
<acierto> I provided the full information about my simple setup here: https://stackoverflow.com/questions/44144555/how-properly-add-str-module-to-oasis-config
<barcabuona> also it's of no theoretical relevance
<acierto> As I can put pics and other stuff
<octachron> barcabuona, by defining a proper store type
<acierto> would be appreciate for help, as I stuck here :(
<barcabuona> anyway i think i can at most do like i did here let env' (key:ide) (value:value) (oldenv:env): env = function id -> if id=key then value else (oldenv id) but that is ugly
<Drup> https://github.com/chambart/ocaml-nullable-array That one is going to be good
jnavila has joined #ocaml
<barcabuona> octachron: a proper store type is of loc->value
jnavila has quit [Remote host closed the connection]
<barcabuona> it's perfect for theory to define a mapping like that
<barcabuona> even if the mapping is mutable mathematics dont care
<barcabuona> also why do you say i want to use a hash table?
<octachron> barcabuona, software are far more precise than mathematics for this kind of details: non-constructivist mathematics does not care about constructing objects
<octachron> sofwares have not choice but to care
<Drup> acierto: you redid "oasis setup" ?
mengu has joined #ocaml
<octachron> Drup, I love the warnings (and the comments in general) in the nullable-array ml file
<Drup> octachron: me too
<acierto> Redid? I just added manually that line
<barcabuona> octachron: so youre basically saying let a store be actual memory and just apply to it a different function instead of using it like a function?
<Drup> acierto: you should rerun "oasis setup" each time you modify _oasis
<acierto> oh....
<octachron> barcabuona, yes!!!
<acierto> finally it works!! Thanks Drup!! :)
<Drup> octachron: that module is actually a decent introduction to the perils and trickiness of obj.magic and float arrays
<Drup> well, "introduction" is probably the wrong term
stux|RC-only has joined #ocaml
<barcabuona> or i could use a find function that just returns the whole memory when given a particular input?
olibjerd has quit [Quit: olibjerd]
_andre has quit [Quit: leaving]
<barcabuona> let findstore (m:storemem) (l:loc):mvalue = let reset = Nativeint.minus_one in match l with reset -> m | _ -> Array.get m (Nativeint.to_int l) (* just a helper *)
<barcabuona> got any tricks up your sleeves?
<barcabuona> maybe have some sort of failwith m that i can then try to catch? that way `find` still retains its type
<Drup> I have a fabulous trick
<Drup> Use. An. Array.
acierto has quit [Quit: Page closed]
<Drup> (or an Hashtabl, or a Map, whichever the datastructure is appropriate)
Armael has joined #ocaml
Algebr has quit [Ping timeout: 245 seconds]
<barcabuona> Drup: but that is an array
<barcabuona> i just have reained the original typing
<barcabuona> why should memory not be allowed to be represented as a function?
<barcabuona> of course the real issue here is copying a function
<Drup> No, the real issue is that you insist that everything should be function
<barcabuona> because it should
<Drup> this is completely a self-inflicted issues due to your stuborness
<barcabuona> i dont see why memory canno t be represented as a function
<companion_cube> because it's awfully inefficient
<Drup> and it's the wrong API
<Drup> You can only do one thing with a function: calling it
<Drup> you can do a lot more stuff with datastructures
<barcabuona> in logic you can also replace values inside
<barcabuona> p[x <- 5]
<Armael> btw the CPU doesn't know about functions, they're implemented using more basic blocks
<barcabuona> p is a function
<Armael> like e.g arrays
<Drup> But OCaml functions are NOT LOGIC
<barcabuona> but self replication has to be possible
<barcabuona> something that i can use to get the array out of there
<barcabuona> i just really cant change that datatype store its too essential
<def`_> (fork can save you)
<Drup> And honestly, to be fairly blunt, I don't see why anyone should try to help you, since you certainly decided our advice were not good enough for you.
<barcabuona> i understand your frustation for me not following your advice
<barcabuona> it is a design choice
<barcabuona> i cannoot do much about it anyway
spew has joined #ocaml
<barcabuona> def`_: is that a pun? like forking off the whole program?
<def`_> yes, and it is a pun
<Drup> No, it's you ignoring any sort of argument that doesn't align to what you decided before hand. We told you multiple time that OCaml functions and mathematical function are not the same, and that it's not because it's called "function" in your paper that you should implement with OCaml functions, that there are a lot of better design choices that would make your program much easier to implement.
ontologiae has joined #ocaml
yomimono has quit [Quit: Ex-Chat]
ollehar has joined #ocaml
flux has quit [Write error: Broken pipe]
groovy2shoes has quit [Excess Flood]
groovy2shoes has joined #ocaml
<barcabuona> Drup: i cannot say i don't agree with you myself to be honest....being it my job to implement something as faithful to theory as possible i believe still i should implement this with the function hack (to be blunt - screw memory consumption for now), as to allow any user to replace my environment/store with a function. even though i am not following your advice i bear in mind what you have explained and will
<barcabuona> try to pursue that in a future experiment. i still want thank you all for the help you've given me, it has been very tolerant of you :).
<barcabuona> i think i now understand the issue anyway. i should not hope for my interpreter to be as modular as the theory in real life. all the components should be "private" to the interpreter, so to say. otherwise only extensions to a function will be of poor choice. i will be sure to mention that to my supervisor
flux has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
moei has quit [Quit: Leaving...]
Simn has quit [Read error: Connection reset by peer]
spew has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
<rgrinberg> I have a simple tyxml_js example that compiles but fails with the following message
<rgrinberg> Uncaught TypeError: runtime.caml_weak_create is not a function
<rgrinberg> what gives?
tane has quit [Quit: Leaving]
spew has quit [Ping timeout: 240 seconds]
<Drup> add +weak.js to jsoo's cli
<Drup> (I don't remember we needed that for tyxml_js, though)
<Drup> (ah, yes, react, of course)
<rgrinberg> I added js_of_ocaml.weak to the deps, how come that isn't enough?
<rgrinberg> ah that's b/c jbuilder doesn't support findlib predicates
<rgrinberg> dammit
<Drup> rgrinberg: yeah, that's why I'm not very happy about jbuilder's handling of findlib :/
<rgrinberg> Curiously, hugo added a test for it
<rgrinberg> so he expected this to work
average has quit [Ping timeout: 245 seconds]
average has joined #ocaml
ollehar has quit [Quit: ollehar]
Rome has quit [Read error: Connection reset by peer]
Rome has joined #ocaml
kakadu has quit [Remote host closed the connection]
spew has joined #ocaml
dmj` has quit [Ping timeout: 240 seconds]
dmj` has joined #ocaml
larhat has quit [Quit: Leaving.]
shinnya has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
ygrek has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
gjaldon__ has quit [Ping timeout: 240 seconds]
gjaldon__ has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
spew has quit [Ping timeout: 240 seconds]
spew_ has joined #ocaml
spew_ has quit [Ping timeout: 246 seconds]
jeroud has quit [Read error: Connection reset by peer]
jeroud has joined #ocaml
cojy has quit [Ping timeout: 240 seconds]
cojy has joined #ocaml
sh0t has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 240 seconds]
aconz2 has quit [Ping timeout: 260 seconds]
spew has joined #ocaml
spew has quit [Quit: foobar]
spew has joined #ocaml
sgronblo has joined #ocaml
infinity0_ has joined #ocaml
infinity0 is now known as Guest89046
infinity0_ is now known as infinity0
infinity0 has joined #ocaml
infinity0 has quit [Changing host]
Guest89046 has quit [Ping timeout: 240 seconds]