<dieggsy>
sleepydog: that is more writing, and also ~$ doesn't work in Z.Compare()
<sleepydog>
i agree it's more writing. what is ~$ ?
<dieggsy>
sleepydog: an alias for of_int
<sleepydog>
oh, i see. that's in the outer Z module. heh
<dieggsy>
Still though, this issue only happens when opening base
<dieggsy>
so = /does/ still work in Z.() /if/ you're not using base
<sleepydog>
well, without base you're getting the poly compare
<dieggsy>
Ah, right.
<sleepydog>
i think it's best to just live with the "ugly" Z.equal
<sleepydog>
or ask about changing Zarith back
<dieggsy>
i agree, i think i like what base has to offer
<dieggsy>
sleepydog: do you use base or no?
<sleepydog>
i don't
<dieggsy>
maybe i should just try that huh
<sleepydog>
if you use base extensively i think you'll probably miss it. it's much bigger than ocaml stdlib
<dieggsy>
sleepydog: i've only just started using OCaml actually, i have a total of 10 short files written
<dieggsy>
so maybe i can live without it
<dieggsy>
i was just trying it because it was recommended various places
<dieggsy>
hah, well I like % and List.range. those are nice
<sleepydog>
is % modulo ?
<dieggsy>
yeah
<dieggsy>
they also have named parameters for things like fold/filter, so you can do ~f: and put the arguments in any intuitive order. maybe i'll stick to base after all lol
<sleepydog>
i don't think you should switch from base over this zarith issue, especially since it doesn't really "fix" the issue.
<sleepydog>
i like to use the stdlib because if i end up sharing my code it won't require several MB of dependencies, and i have more faith that ocaml stdlib will stay backwards compatible
<dieggsy>
See, but i value those thing stoo
<dieggsy>
right now i'm just re-doing some project euler problems in ocaml, so it's not like it matters
<dieggsy>
it's just my brain being like "go the minimalist/portable route"
<sleepydog>
heh. i have that same urge too, and i think it holds me back from getting anything done a lot of the time
<dieggsy>
that's fair
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
<dieggsy>
oof, standard library doesn't even have stuff like string reversal
<dh`>
there is no exec system call, exec is a family of functions
<dh`>
execve is the base one
<hackinghorn>
I can call Unix.exec, its on the page I showed
<hackinghorn>
its weird eh
mxns has joined #ocaml
<dh`>
that's just a wrapper
<dh`>
and not of any particular use
<hackinghorn>
or are they not the same Unix
<sleepydog>
hackinghorn: like companion_cube said, that is from an alternate stdlib.
<hackinghorn>
wow, I see, the alternate one
<sleepydog>
the built-in stdlib more closely follows the actual system calls available on a unix system, so you use execv or execve
<hackinghorn>
so janestreet has a different Unix
<dh`>
or execvp or execvpe
<dh`>
doesn't have execl* but that's kinda pointless in ocaml
<hackinghorn>
ah I see, thxx
<dh`>
(execvp, execvpe, and execv are libc-level wrappers around the execve system call)
mxns has quit [Ping timeout: 248 seconds]
<hackinghorn>
can I use both stdlib at the same time?
<hackinghorn>
how do I know which one I'm using?
<hackinghorn>
I can go to definition but what after that?
zebrag has quit [Quit: Konversation terminated!]
mxns has joined #ocaml
mxns has quit [Ping timeout: 248 seconds]
White_Flame has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
White_Flame has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
<hackinghorn>
hi anyone?
mxns has quit [Ping timeout: 240 seconds]
White_Flame has quit [Ping timeout: 260 seconds]
mfp has quit [Ping timeout: 260 seconds]
<sleepydog>
hackinghorn: it's better to use one or the other
<sleepydog>
if you have `open Base` at the top of your ocaml file, you're using Base. otherwise you're using the built-in stdlib
<sleepydog>
you should just go with whatever is used in the learning material you're using
<hackinghorn>
ahh, I see
<hackinghorn>
so if I see 'open Base' I should stick with Base, if I dont see it, I stick with built-in stdlib
<hackinghorn>
I guess I can use both but shouldn't
<sleepydog>
it's a pain to use both
<sleepydog>
but i think Base makes the ocaml stdlib available under a different name if you need it
<hackinghorn>
I see "open Core", Core is Base' extension?
<hackinghorn>
ah thats right
tryte has quit [Remote host closed the connection]
tryte has joined #ocaml
<hackinghorn>
eh, how do I fix this code: open Core print_endline "Hello"
<hackinghorn>
open Core;; I think
curtosis[away] has joined #ocaml
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Deek9399 has joined #ocaml
mbuf has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
narimiran has joined #ocaml
Serpent7776 has joined #ocaml
Sonakshi has joined #ocaml
Sonakshi has quit [Quit: Connection closed]
Deek9399 has quit [Quit: Connection closed]
neiluj has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
neiluj has quit [Remote host closed the connection]
olle_ has joined #ocaml
olle_ has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
bronsen has quit [*.net *.split]
|jbrown| has quit [*.net *.split]
dwt has quit [*.net *.split]
nullcone has quit [*.net *.split]
thizanne has quit [*.net *.split]
raver has quit [*.net *.split]
webshinra has quit [*.net *.split]
SrPx has quit [*.net *.split]
terabit has quit [*.net *.split]
cemerick has quit [*.net *.split]
b20n has quit [*.net *.split]
takside has quit [*.net *.split]
lisq has quit [*.net *.split]
cbarrett has quit [*.net *.split]
theglass has quit [*.net *.split]
caasih has quit [*.net *.split]
RalfJ has quit [*.net *.split]
_ks has quit [*.net *.split]
Enjolras has quit [*.net *.split]
mosterdt__ has quit [*.net *.split]
Ekho has quit [*.net *.split]
infinigon_ has quit [*.net *.split]
radiopotin[m] has quit [*.net *.split]
averell has quit [*.net *.split]
nfc has quit [*.net *.split]
_habnabit has quit [*.net *.split]
tmhoang520 has quit [*.net *.split]
Johann has quit [*.net *.split]
OPeritel_ has quit [*.net *.split]
drakonis has quit [*.net *.split]
Putonlalla has quit [*.net *.split]
dinosaure has quit [*.net *.split]
SoF has quit [*.net *.split]
stylewarning has quit [*.net *.split]
gahr has quit [*.net *.split]
eternalgeek[m] has quit [*.net *.split]
lnxw37d4 has quit [*.net *.split]
tryte has quit [*.net *.split]
cantstanya has quit [*.net *.split]
andreas303 has quit [*.net *.split]
nicoo has quit [*.net *.split]
aditi314 has quit [*.net *.split]
BitPuffin has quit [*.net *.split]
penguwin has quit [*.net *.split]
bacam has quit [*.net *.split]
Drup has quit [*.net *.split]
rfv has quit [*.net *.split]
artart78 has quit [*.net *.split]
smondet[m] has quit [*.net *.split]
pqwy[m] has quit [*.net *.split]
peddie has quit [*.net *.split]
Sumera[m] has quit [*.net *.split]
tristanC has quit [*.net *.split]
conjunctive has quit [*.net *.split]
Leonidas has quit [*.net *.split]
adrianbrink has quit [*.net *.split]
wagle has quit [*.net *.split]
vodkaInf1rno has quit [*.net *.split]
delysin has quit [*.net *.split]
dmbaturin has quit [*.net *.split]
incoh has quit [*.net *.split]
kini has quit [*.net *.split]
Duns_Scrotus has quit [*.net *.split]
mrallen1 has quit [*.net *.split]
jimt[m] has quit [*.net *.split]
ocabot has quit [*.net *.split]
reynir has quit [*.net *.split]
sar has quit [*.net *.split]
cqc has quit [*.net *.split]
zozozo has quit [*.net *.split]
beaky has quit [*.net *.split]
stux|RC-only has quit [*.net *.split]
dieggsy has quit [*.net *.split]
bytesighs has quit [*.net *.split]
stephe has quit [*.net *.split]
angerman has quit [*.net *.split]
wildsebastian has quit [*.net *.split]
robmyers has quit [*.net *.split]
adi__________ has quit [*.net *.split]
pmonson has quit [*.net *.split]
ipavlo has quit [*.net *.split]
copy_ has quit [*.net *.split]
oznt has quit [*.net *.split]
ski has quit [*.net *.split]
osa1 has quit [*.net *.split]
rak has quit [*.net *.split]
troydm has quit [*.net *.split]
companion_cube has quit [*.net *.split]
Chouhartem has quit [*.net *.split]
ahf has quit [*.net *.split]
Ankhers has quit [*.net *.split]
infinity0 has quit [*.net *.split]
p4bl0 has quit [*.net *.split]
ebb has quit [*.net *.split]
l1x has quit [*.net *.split]
higherorder__ has quit [*.net *.split]
JSharp has quit [*.net *.split]
omni has quit [*.net *.split]
mgsk has quit [*.net *.split]
d_bot has quit [*.net *.split]
Fardale has quit [*.net *.split]
CcxWrk has quit [*.net *.split]
rom1504 has quit [*.net *.split]
lopex has quit [*.net *.split]
ec has quit [*.net *.split]
Geekingfrog has quit [*.net *.split]
leah2 has quit [*.net *.split]
metadave has quit [*.net *.split]
vicfred has quit [*.net *.split]
rpcope has quit [*.net *.split]
daimrod has quit [*.net *.split]
adrien has quit [*.net *.split]
jmct has quit [*.net *.split]
pippijn has quit [*.net *.split]
brettgilio has quit [*.net *.split]
narimiran has quit [*.net *.split]
hackinghorn has quit [*.net *.split]
olle has quit [*.net *.split]
TC01 has quit [*.net *.split]
aquijoule_ has quit [*.net *.split]
xandkar has quit [*.net *.split]
freshmaker666 has quit [*.net *.split]
schlaftier has quit [*.net *.split]
rwmjones has quit [*.net *.split]
mbuf has quit [*.net *.split]
dh` has quit [*.net *.split]
tizoc has quit [*.net *.split]
iZsh has quit [*.net *.split]
hannes has quit [*.net *.split]
sleepydog has quit [*.net *.split]
runawayfive has quit [*.net *.split]
beajeanm has quit [*.net *.split]
terrorjack has quit [*.net *.split]
valtr has quit [*.net *.split]
interruptinuse has quit [*.net *.split]
dx has quit [*.net *.split]
clockish has quit [*.net *.split]
ansiwen_ has quit [*.net *.split]
johnelse has quit [*.net *.split]
dan64- has quit [*.net *.split]
jca has quit [*.net *.split]
mrd has quit [*.net *.split]
nore has quit [*.net *.split]
sim642 has quit [*.net *.split]
eagleflo has quit [*.net *.split]
remexre has quit [*.net *.split]
lobo has quit [*.net *.split]
asm89 has quit [*.net *.split]
seliopou has quit [*.net *.split]
rntz2 has quit [*.net *.split]
theblatte has quit [*.net *.split]
srax has quit [*.net *.split]
jsoo has quit [*.net *.split]
madroach has quit [*.net *.split]
octachron has quit [*.net *.split]
xenu has quit [*.net *.split]
zmagii has quit [*.net *.split]
_tjr_ has quit [*.net *.split]
haskell_1 has quit [*.net *.split]
Exagone313 has quit [*.net *.split]
drewolson has quit [*.net *.split]
rks` has quit [*.net *.split]
avsm[m] has quit [*.net *.split]
dash has quit [*.net *.split]
flux has quit [*.net *.split]
breitenj has quit [*.net *.split]
runciter has quit [*.net *.split]
chewbranca has quit [*.net *.split]
madgen_ has quit [*.net *.split]
jeroud has quit [*.net *.split]
Armael has quit [*.net *.split]
cross has quit [*.net *.split]
Nahra has quit [*.net *.split]
Serpent7776 has quit [*.net *.split]
landonf has quit [*.net *.split]
chripell_ has quit [*.net *.split]
shmibs has quit [*.net *.split]
mal`` has quit [*.net *.split]
stux|RC has quit [*.net *.split]
so_ has quit [*.net *.split]
engil has quit [*.net *.split]
Haudegen has quit [*.net *.split]
dckc has quit [*.net *.split]
Amaan has quit [*.net *.split]
alexey has quit [*.net *.split]
SquidDev has quit [*.net *.split]
haesbaert has quit [*.net *.split]
emias has quit [*.net *.split]
arecaceae has quit [*.net *.split]
tjammer[m] has quit [*.net *.split]
qwr has quit [*.net *.split]
sadiq has quit [*.net *.split]
greenbagels has quit [*.net *.split]
steenuil has quit [*.net *.split]
labor[m] has quit [Ping timeout: 276 seconds]
aspiwack[m] has quit [Ping timeout: 276 seconds]
ec has joined #ocaml
ebb has joined #ocaml
ec has quit [Ping timeout: 250 seconds]
tryte has joined #ocaml
cantstanya has joined #ocaml
andreas303 has joined #ocaml
nicoo has joined #ocaml
stephe has joined #ocaml
chewbranca has joined #ocaml
wildsebastian has joined #ocaml
JSharp has joined #ocaml
stylewarning has joined #ocaml
ahf has joined #ocaml
angerman has joined #ocaml
conjunctive has joined #ocaml
cbarrett has joined #ocaml
higherorder__ has joined #ocaml
ec has joined #ocaml
SrPx has joined #ocaml
rfv has joined #ocaml
nullcone has joined #ocaml
andreas303 has quit [Ping timeout: 240 seconds]
andreas303 has joined #ocaml
bartholin has joined #ocaml
adrianbrink has joined #ocaml
wildsebastian has joined #ocaml
stephe has joined #ocaml
stephe has quit [Changing host]
wildsebastian has quit [Changing host]
stylewarning has joined #ocaml
conjunctive has joined #ocaml
higherorder__ has joined #ocaml
ec has joined #ocaml
SrPx has joined #ocaml
angerman has joined #ocaml
nullcone has joined #ocaml
rfv has joined #ocaml
angerman has quit [Changing host]
stylewarning has quit [Changing host]
conjunctive has quit [Changing host]
higherorder__ has quit [Changing host]
ec has quit [Changing host]
SrPx has quit [Changing host]
nullcone has quit [Changing host]
rfv has quit [Changing host]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
olle has joined #ocaml
BitPuffin has joined #ocaml
Exagone313 has joined #ocaml
madroach has joined #ocaml
jsoo has joined #ocaml
5EXAABHZ9 has joined #ocaml
_tjr_ has joined #ocaml
zmagii has joined #ocaml
octachron has joined #ocaml
xenu has joined #ocaml
rks` has joined #ocaml
drewolson has joined #ocaml
haskell_1 has joined #ocaml
<hackinghorn>
hi, what does ~ mean in functions?
<olle>
Named argument? Or negation?
<olle>
Context
Sumera[m] has joined #ocaml
dieggsy has joined #ocaml
radiopotin[m] has joined #ocaml
aspiwack[m] has joined #ocaml
dash has joined #ocaml
labor[m] has joined #ocaml
peddie has joined #ocaml
flux has joined #ocaml
jimt[m] has joined #ocaml
avsm[m] has joined #ocaml
pqwy[m] has joined #ocaml
aditi314 has joined #ocaml
smondet[m] has joined #ocaml
lnxw37d4 has joined #ocaml
eternalgeek[m] has joined #ocaml
tjammer[m] has joined #ocaml
<hackinghorn>
olle, thanks, on the description of String.split:
<hackinghorn>
val split : t -> on:char -> t list
<hackinghorn>
split s ~on returns a list of substrings of s that are separated by on. Consecutive on characters will cause multiple empty strings in the result. Splitting the empty string returns a list of the empty string, not the empty list.
<hackinghorn>
can you give an example of String.split
<hackinghorn>
I tried it first time but looks like I got syntax error
tane has joined #ocaml
<olle>
I actually can't
<olle>
But anyone else can
<olle>
If they're awake :)
<thizanne>
String.split ~on:',' "a,b,c"
<olle>
There ya go
<hackinghorn>
ah thankss
<hackinghorn>
thizanne, the ~on: is mandatory?, I tried, String.split "a,b,c" ',' and it doesnt work
<hackinghorn>
thanks, I will try this way
<thizanne>
hackinghorn: yes, that's a named argument
<thizanne>
(for completeness, sometimes you can omit the name, but just consider you can't)
<hackinghorn>
I understand that Ocaml don't like loops
<hackinghorn>
how to loop thru a list the Ocaml way?
<d_bot>
<EduardoRFS> List.iter?
<Armael>
or write a recursive function
<thizanne>
^
<d_bot>
<EduardoRFS> yeah, but lists are recursive normally, it's terrible everytime I see someone doing linked lists with loops
<hackinghorn>
ah, I will try List.iter, thankss
<olle>
map, fold, iter
<hackinghorn>
I want to loop thru a List, but if condition x is satisfied, I stop the loop. How to do that?
<hackinghorn>
x is satisfied for element a of the list
<Armael>
write a recursive function
<hackinghorn>
ah I see, thats probably it
<d_bot>
<EduardoRFS> or List.find
<hackinghorn>
hehehe thanks
<olle>
filter
Serpent7776 has joined #ocaml
<olle>
and find_opt, I guess
<olle>
instead of find
<hackinghorn>
ahh great, thankss
<hackinghorn>
find returns an 'a option and find_exn returns an 'a. What does exn stand for? I see it a lot
<steenuil>
exn stands for exception
<hackinghorn>
ah, thankss
<steenuil>
can two different variants in the same module have the same name? e.g. `type a = A | B;; type b = A | C`?
<octachron>
Yes, but using the first one will require type-directed disambiguation
<steenuil>
hmm I see
<olle>
new feature, I think? to allow this?
<olle>
that always was a problem with record fields before
<olle>
They changed it to find_exn? So there's both _opt and _exn in the standard lib now? oO
<octachron>
If new means "less than seven years old". This was added in 4.01.0.
<olle>
:)
<olle>
I did most of my OCaml programming 3.12
mfp has joined #ocaml
<steenuil>
huh I thought there would be a find_index function in the List module but there's none
<olle>
nth
<steenuil>
that's indexing a list
<steenuil>
find_index would be ('a -> bool) -> 'a list -> int
<steenuil>
or int option
<olle>
?
<octachron>
find_index is kind of useless? since you will still need to traverse the list to use the index.
<octachron>
Thinking of indices is a good sign that we should be using arrays and not lists.
<steenuil>
I guess
<steenuil>
I have to remove duplicates from a list, I didn't really want to use fold_left but I guess I'll have to
<steenuil>
has there ever been discussion for adding a uniq function to List?
<octachron>
Removing non-consecutive duplicates from a list should be done by transforming the list into a set.
<steenuil>
maybe I want to preserve the order
<octachron>
Decorate the list with the initial order, and then convert to a set.
<steenuil>
I can see that but I find that a bit too laborious for something as simple as removing duplicates
<octachron>
Or you can fold_left with a set. Overall, it is a two or three line function.
<hackinghorn>
how can I get a substring starting at 5th character?
<hackinghorn>
I'm using Base
<hackinghorn>
looks like Base doesnt have String.sub?
<steenuil>
yeah, but still, it's a two or three line function that I'll have to rewrite every time I need to use it
<hackinghorn>
oh it does, silly me lol
<thizanne>
steenuil: that really looks like you shouldn't be using lists in the first place though
<thizanne>
what are you actually trying to do?
zebrag has joined #ocaml
<steenuil>
it's an AST, there's a million other ways I could do this but this is the quickest :P
<steenuil>
basically there's a pass where I add some nodes in certain situations and I noticed I ended up with duplicate nodes
<steenuil>
nodes = declarations
<thizanne>
well you could start with not adding a node if it's already there (if List.mem ...)
<steenuil>
yeah, like I said, there's a million other ways I could do it
<hackinghorn>
wait, I can't find String.sub in Base
<hackinghorn>
only in stdlib
<hackinghorn>
I have to use String.sub from stdlib?
<hackinghorn>
wait, Base does have String.sub
<hackinghorn>
but I don't see it in the doc
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
gareppa has joined #ocaml
mxns has joined #ocaml
gareppa has quit [Remote host closed the connection]
Fardale has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
waleee-cl has joined #ocaml
<d_bot>
<fangyi> It's written in an non-obvious way
<d_bot>
<fangyi> "val sub : (t, t) Blit.sub"
<d_bot>
<fangyi> where "type nonrec ('src, 'dst) sub = ('src, 'dst) Base__.Blit_intf.sub" and "type ('src, 'dst) sub = 'src -> pos:int -> len:int -> 'dst"
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
5EXAABHZ9 has quit [Quit: Aloha!]
stux|RC has joined #ocaml
Goodiec has joined #ocaml
narimiran has joined #ocaml
SDAChess has joined #ocaml
SDAChess has left #ocaml [#ocaml]
zebrag has quit [Quit: Konversation terminated!]
Haudegen has joined #ocaml
zebrag has joined #ocaml
cantstanya has quit [Remote host closed the connection]
mxns has joined #ocaml
Sakshi has joined #ocaml
Sakshi has quit [Client Quit]
Goodiec has quit [Ping timeout: 240 seconds]
olle has quit [Ping timeout: 245 seconds]
mariaikoro has joined #ocaml
<d_bot>
<EduardoRFS> There was any discussion about switching the OCaml CLI to cmdliner? Or something a bit more fancy?
<d_bot>
<Drup> This means integrating cmdliner inside the compiler
<d_bot>
<Drup> and that is seen as rather ... non desirable, for gains that are not very big, especially since nowadays, nobody compilers ocaml by hand
waleee-cl has quit [Quit: Connection closed for inactivity]
<d_bot>
<Drup> the more objective look on this is: "Whatever the feature provided by cmdliner, if it's considered so desirable that we want it in the compiler, we can certainly finds way to add it with `Args`"
<d_bot>
<Drup> (unfortunately, that doesn't completely hold for "sane CLI definition in the code", but that's another story)
<companion_cube>
Arg isn't that bad -_-
<d_bot>
<Drup> companion_cube: it isn't, but Args doesn't allo you to easily 1) define self-contained subterms 2) reuse subterms in different CLIs
<companion_cube>
no, but for ocamlc it's probably fine?
<d_bot>
<Drup> which is something that would simplify the driver's code immensely.
<companion_cube>
fwiw cmdliner has this weird limitation that it can't nest further than 2
<companion_cube>
which… 🤷
<d_bot>
<Drup> can't nest subcommands, but we don't care about that
<d_bot>
<Drup> I'm talking about "terms" as in "bunches of arguments", not subcommands
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
<companion_cube>
ah well, you can reuse list of options, as long as the stuff they change is shared
<d_bot>
<Drup> yeah, and the result is mutable stuff flying everywhere
<d_bot>
<Drup> everyone who has touched the compiler driver will tell you how painful the result is
<companion_cube>
I mean, I don't disagree
<companion_cube>
cmdliner just doesn't strike me as being particularly simpler, especially when you need to make functions with 50 arguments to fit into the applicative framework
<d_bot>
<Drup> The main difference for me is that you can abstract/encapsulate several arguments into a term
<companion_cube>
at this point, maybe a lightweight applicative parser could be added to the compiler?
<companion_cube>
("how hard can it be", lolol)
<d_bot>
<Drup> I don't know. I think everyone just gave up of every cleaning this part of the code until it gain sentience and decide to turn on its creators
<companion_cube>
tbh I wish we had more stuff in .ml files, and less on the command line
<d_bot>
<EduardoRFS> nobody, except people developing tools who wants sane args. But yeah the idea is not necessarily cmdliner.
<d_bot>
<EduardoRFS>
<d_bot>
<EduardoRFS> Would be cool if there was a way to bail out of cmdliner like with menhir
waleee-cl has joined #ocaml
<companion_cube>
wouldn't it be cool if you could just give ocaml a json object on stdin to specify the arguments? :p
<companion_cube>
for tool writers it's probably simpler this way
Tuplanolla has joined #ocaml
bartholin has quit [Quit: Leaving]
SquidDev has joined #ocaml
mxns has joined #ocaml
SquidDev has quit [Client Quit]
SquidDev has joined #ocaml
Goodiec has quit [Quit: Connection closed]
<d_bot>
<Drup> Honestly, even then, you don't really need it: Any such tool will probably not be user-facing either, but only used through .. a build system. And in that case, your best bet is to preserve the compiler's CLI as much as possible
SquidDev has quit [Quit: Bye!]
SquidDev has joined #ocaml
TheLemonMan has joined #ocaml
mariaikoro has left #ocaml [#ocaml]
Haudegen has joined #ocaml
ArthurStrong has joined #ocaml
<zozozo>
i confirm that adding an option to the compiler is... annoying at least, :p
<zozozo>
we have a lof of that with flambda, XD
<companion_cube>
I recommend Sys.getenv_opt :)
<companion_cube>
👿
<zozozo>
we have that too
<zozozo>
...
<companion_cube>
tbh for any flag that is in `flambda \ ocamlopt` it kind of makes sense… bypass the build system :)
<companion_cube>
(for debug stuff, ofc; for the rest I hope regular ocamlopt will accept the same options and just ignore them)
olle_ has joined #ocaml
<d_bot>
<rgrinberg> @EduardoRFS don't waste time on improving the driver, what we really need is a "server" mode for the compiler
<d_bot>
<EduardoRFS> agreed, but it's because of a friend of mine wasted his time on `bsc` for Melange, then I was thinking "we could maybe use this for OCaml"
<d_bot>
<rgrinberg> I mean, if there's a use case for running `bsc` manually then it makes sense
<d_bot>
<rgrinberg> but it never makes sense for the OCaml compiler
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
vicfred has joined #ocaml
olle_ has quit [Ping timeout: 240 seconds]
<d_bot>
<Robin> hello i don't know where to ask so i'm putting that here:
<d_bot>
<Robin> let melange_knuth t=
<d_bot>
<Robin> for i=0 to (Array.length (t)-1)
<d_bot>
<Robin> do let j = random.int(k+1)
<d_bot>
<Robin> in let att=t.(j);
<d_bot>
<Robin> t.(j)<-t.(i);
<d_bot>
<Robin> t.(i)<-att
<d_bot>
<Robin> done;
<d_bot>
<Robin> t;;
<d_bot>
<Robin> i don't know where there is a mistake in the syntaxe
<d_bot>
<Robin> can someone help me?
<d_bot>
<octachron> The binding syntax is `let ... = ... in` not `let ... ;`.
mxns has quit [Ping timeout: 250 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
mxns has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
ArthurStrong has quit [Quit: leaving]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
<notnotdan_>
rgrinberg, what do you mean by a 'sever' mode for the compiler?
<companion_cube>
I guess, the compiler would run as a daemon and accept compilation commands on some socket
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
<steenuil>
at that point wouldn't it be better to have the compiler be usable as a library?
oriba has joined #ocaml
curtosis has joined #ocaml
<companion_cube>
it's already usable as a library
narimiran has quit [Ping timeout: 260 seconds]
<steenuil>
oh.
<companion_cube>
however I'm not sure if the API is stable.
mxns has joined #ocaml
<d_bot>
<rgrinberg> Using it as a library would force us to link it to the build sytem
<d_bot>
<rgrinberg> That would be prohibitive
<companion_cube>
dune is doing RPC with more and more things, rgrinberg, correct?
<d_bot>
<rgrinberg> Whenever we need loose coupling it makes sense to go with RPC
<d_bot>
<rgrinberg> But we only recently gained a usable RPC mechanism
<d_bot>
<rgrinberg> so we're still trying to adopt it where possible
<steenuil>
what's a good way to represent a bitmask?
<companion_cube>
steenuil: an int, with bitwise operations :)
<companion_cube>
rgrinberg: right. Based on csexp, correct?
<d_bot>
<rgrinberg> Yeah
<d_bot>
<rgrinberg> Quit similar to jsonrpc actually. But with csexp instead of json
<steenuil>
eh. I was thinking either a list of enums or something with a functor and some infix operator to compose them
<steenuil>
list of enums sounds like the most lightweight
<companion_cube>
yeah csexp >> json
<d_bot>
<rgrinberg> How is that more lightweight than a single 64 bit integer?
<companion_cube>
I mean, hello binary-safe encoding
<d_bot>
<rgrinberg> 63*
<steenuil>
I mean in a type-safe manner, rgrinberg
<d_bot>
<rgrinberg> The thing is, you might as well just use a set if you're going to have such an inefficient representation
<steenuil>
obviously an int would be better, but there's a lot of bitmasks in the API