<companion_cube>
because I keep getting strange errors about make.bc not having a .ml file, or about run_qtest.o having several targets, or whatever
<companion_cube>
been stuck like 45min, I give up
pierpa has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
govg has joined #ocaml
spew has quit [Read error: Connection reset by peer]
spew has joined #ocaml
jbrown has quit [Ping timeout: 240 seconds]
andreas_ has quit [Quit: Connection closed for inactivity]
spew has quit [Read error: Connection reset by peer]
jao has quit [Ping timeout: 248 seconds]
VermillionAzure has joined #ocaml
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 268 seconds]
<_xvilka__>
hi
<pierpa>
ho
<_xvilka__>
I am doing dumb debug - checking the keys presence in Hashtbl. So I have code like this: Hashtbl.iter_keys tbl (fun k -> qwe := !qwe ^ k; ())
<_xvilka__>
but it returns me an error: this expression is a type of string but expected to be 'a -> 'b -> 'c list
<_xvilka__>
so I'm not sure where did it get this type from, looks very strange
<_xvilka__>
where `let qwe = ref ""`
<pierpa>
I can't find Hashtbl.iter_keys in the manual. That's a first problem.
<_xvilka__>
pierpa: ah, forgot to mention it is Core.Hashtbl.iter_keys
<_xvilka__>
Same error (expects 'a -> 'b) if I do: let qwe = Core.Hashtbl.fold ~init:"" (fun k v acc -> acc ^ k)
<_xvilka__>
too bad ocaml doesn't have the feature to get the string name/signature of the type programmatically
<pierpa>
what's the type of this iter_keys?
<companion_cube>
_xvilka__: types simply don't exist at runtime
<companion_cube>
so it's impossible to turn them into strings
<_xvilka__>
companion_cube: yes, I know. I meant compiler can calculate them at compilation time
<_xvilka__>
companion_cube: like Haskell does with its TemplateHaskell
<_xvilka__>
pierpa: val iter_keys : ('a, 'b) Hashtbl.t -> f:('a -> unit) -> unit
<pierpa>
_xvilka__: Looks tame :) then no clue, Sorry.
<pierpa>
could the problem be in surrounding code that you have not shown us?
<_xvilka__>
pierpa: it can be, yeah, this is why I try to get the contents of this hashtable. Too bad the program itself is very complex and abstract to just check the types with merlin
<lpollen>
anyway, Hashtbl.mem will tell you if something is a hash table. in Core as well.
<pierpa>
"Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" B. Kernighan
<_xvilka__>
lpollen: well, I know it is a hashtable, and I use mem/find. I just want to iterate and print all contents of it
<_xvilka__>
pierpa: true
<lpollen>
_xvilka__: try using a Hashtbl.iteri that prints out the k/v mappings directly.
<_xvilka__>
lpollen: well, error is still the same - it think key is not string
<_xvilka__>
*thinks
<lpollen>
the key's probably not a string then.
<_xvilka__>
yeah, which is weird, because in program this table created with String.Table.create ()
<lpollen>
I feel like Core has some kind of "turn anything to readable s-expressions" faculty that you might use, but I'm waiting for something like a book to come out that corresponds to the available code :)
<lpollen>
well since you're confused already, maybe that confusion extends to how the Hashtbl you have was actualy created
<lpollen>
let x = String.Table.create () ~size:4 in (Hashtbl.set x ~key:"hello" ~data:"there"; Hashtbl.set x ~key:"mon" ~data:"frere"; Hashtbl.iteri x (fun ~key ~data -> printf "%s -> %s\n" key data));;
<lpollen>
outputs what you'd expect.
<_xvilka__>
true, works flawlessly in utop
<lpollen>
one thing you can do is find where you create the hash table and then immediately set a dummy string to a value. You can then take it back out if you want. The point is to fix the type of the hash table at that point, so whatever you go on to that's wrong will fail with a type error.
<lpollen>
maybe it's more flexible than the name suggests.
<lpollen>
no, actually that doesn't seem to be the case.
<_xvilka__>
ah, good idea, will try
VermillionAzure has quit [Ping timeout: 248 seconds]
pierpa has quit [Quit: Page closed]
<_xvilka__>
lpollen: yeah, this was VERY helpful
dtornabene has joined #ocaml
<_xvilka__>
data is function, but the key is still string
<_xvilka__>
so I'm really confused why my previous code wasn't working
<_xvilka__>
lol, it was so stupid error
<_xvilka__>
I just redefined (^) in this module
mbuf has joined #ocaml
<_xvilka__>
no, my bad, this wasn't the cause
<_xvilka__>
total madness /o\
<_xvilka__>
but anyway solved it different way, thanks for the all help and the fish
cyraxjoe has joined #ocaml
jimmyrcom has quit [Ping timeout: 263 seconds]
MercurialAlchemi has joined #ocaml
rostero has quit [Quit: Connection closed for inactivity]
jimmyrcom has joined #ocaml
freyr has joined #ocaml
<rgrinberg>
companion_cube: your issue is that you're defining 2 exe stanzas in 1 jbuild file but not specifying the modules explicitly
<rgrinberg>
try adding (modules (run_qtest)) to the run_qtest exe and (modules (make)) for make
cbot has quit [Quit: Leaving]
<rgrinberg>
Also, instead of ${exe:make.bc}, you really just want (action (run ./make.exe -target ${@}))
<rgrinberg>
companion_cube: note that there's a similar problem when defining 2 libraries in 1 dir as well. You must tell dune which modules belong to which stanza...
mk9 has joined #ocaml
mk9 has quit [Quit: mk9]
jimmyrcom has quit [Ping timeout: 276 seconds]
gentauro has quit [Ping timeout: 240 seconds]
gentauro has joined #ocaml
jimmyrcom has joined #ocaml
AltGr has joined #ocaml
Haudegen has joined #ocaml
cuicui has joined #ocaml
zpe has joined #ocaml
whoman has quit [Remote host closed the connection]
whoman has joined #ocaml
argent_smith has joined #ocaml
jimt_ has quit [Quit: leaving]
jimt has joined #ocaml
mfp has joined #ocaml
VermillionAzure has joined #ocaml
AltGr has left #ocaml [#ocaml]
mengu has joined #ocaml
jimmyrcom has quit [Ping timeout: 256 seconds]
barcabuona has joined #ocaml
zolk3ri has joined #ocaml
whoman has quit [Remote host closed the connection]
whoman has joined #ocaml
_andre has joined #ocaml
sommebody has joined #ocaml
sommebody has quit [Client Quit]
AltGr has joined #ocaml
mk9 has joined #ocaml
ziyourenxiang has joined #ocaml
mk9 has quit [Quit: mk9]
VermillionAzure has quit [Remote host closed the connection]
mk9 has joined #ocaml
mk9 has quit [Ping timeout: 248 seconds]
mk9 has joined #ocaml
mk9 has quit [Client Quit]
mk9 has joined #ocaml
sapristi has joined #ocaml
mk9 has quit [Quit: mk9]
mk9 has joined #ocaml
sapristi has quit [Ping timeout: 248 seconds]
mk9 has quit [Quit: mk9]
mk9 has joined #ocaml
dhil has joined #ocaml
barcabuona has quit [Ping timeout: 256 seconds]
mk9 has quit [Quit: mk9]
mk9 has joined #ocaml
silver has joined #ocaml
zolk3ri has quit [Quit: leaving]
johnelse has quit [Quit: leaving]
dhil has quit [Ping timeout: 264 seconds]
johnelse has joined #ocaml
johnelse has quit [Client Quit]
mk9 has quit [Ping timeout: 246 seconds]
<orbifx[m]>
Anyone here written or read anything about applying what they have leanred from OCaml to C? (i.e. making C more functional? :P)
whoman has quit [Remote host closed the connection]
<octachron>
Do you mean Rust?
whoman has joined #ocaml
sapristi has joined #ocaml
dhil has joined #ocaml
<dmbaturin>
orbifx[m]: Look up Cyclone language. :)
JeanMax has joined #ocaml
mbuf has quit [Quit: Leaving]
cuicui has quit [Ping timeout: 256 seconds]
andreas_ has joined #ocaml
shinnya has joined #ocaml
<orbifx[m]>
thanks
<orbifx[m]>
dmbaturin: have you used it?
dhil has quit [Ping timeout: 264 seconds]
<orbifx[m]>
Says it's not maintained :'(
<dmbaturin>
orbifx[m]: No, I haven't. It's a research project that wasn't really meant for production use in its original form I suppose.
<orbifx[m]>
Do you know if something took over? It mentioned Rust has elements of it.
BitPuffin has joined #ocaml
<dmbaturin>
I think in a way, Cyclone was a precursor of Rust.
<dmbaturin>
It's like Modula-2. ;)
<dmbaturin>
(Reportedly, some soviet/russian aerospace projects did use Modula-2. That's the only real use of it I've heard of, even that is unconfirmed)
Haudegen has quit [Remote host closed the connection]
mk9 has joined #ocaml
<Drup>
modula-3 has cool modules in it too
dhil has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
johnelse has joined #ocaml
<orbifx[m]>
Cool. I wonder how good Rust's tools are for embedded
govg has joined #ocaml
<reynir>
what cpu architectures does rust target? Anything other than x86?
govg has quit [Ping timeout: 248 seconds]
<Fardale>
webassembly (I know it is not a cpu architectures)
<orbifx[m]>
Thanks reynir. Has anyone used ocaml in embedded systems? In particular flat memory models or places without an OS? (I know it's used on Mirage on top of a visor)
johnelse is now known as johnel_away
johnel_away is now known as johnelse
cuicui has joined #ocaml
Haudegen has joined #ocaml
mrgrieves has joined #ocaml
govg has joined #ocaml
spew has quit [Read error: Connection reset by peer]
jbrown has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
dhil has quit [Ping timeout: 264 seconds]
johnelse is now known as johnel_away
johnel_away is now known as johnelse
dhil has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
sapristi has quit [Quit: Leaving]
johnelse is now known as johnel_away
johnel_away is now known as johnelse
Jesin has quit [Quit: Leaving]
<companion_cube>
rgrinberg: ok, adding explicit modules fixes it
<companion_cube>
but the error is super unclear
<companion_cube>
and I'd rather say the name of the main, than the name of every module…
<companion_cube>
oasis has `MainIs: foo.ml` iirc
MercurialAlchemi has quit [Ping timeout: 264 seconds]
sh0t has joined #ocaml
kamog has quit [Quit: Leaving.]
<Leonidas>
What happened in kernel 2.6.18 that it is used as minimal version? I've seen that particular release a number of times
<companion_cube>
must have been a LTS
<Leonidas>
that's a less exciting explanation than I would have hoped for :-)
<companion_cube>
I mean, maybe it was the last LTS before 3.*
Onemorenickname has joined #ocaml
Onemorenickname has quit [Client Quit]
<Leonidas>
ok. I thought maybe some syscall that is now used a lot and wasn't there in < 2.6.18
Jesin has joined #ocaml
Jesin has quit [Remote host closed the connection]
freyr has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Jesin has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
kakadu has joined #ocaml
sepp2k has joined #ocaml
mk9 has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
jao has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
FreeBirdLjj has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Quit: WeeChat 1.4]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Haudegen has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
hdla has joined #ocaml
<hdla>
i want to install "coq-bignums" which is in coq's repositories. however, when I use OPAM, it forces me to install Coq, even though i already have it via my system's package manager. how can I tell OPAM to skip installing coq?
<reynir>
hdla: I think it's possible to mark a package as installed, but it's Probably Not A Good Idea ™
<reynir>
opam install --fake coq
<kakadu>
installing coq via opam will be safer way to go
<kakadu>
but if you use --fake you should fakeinstall at least the same version of coq that your system is
<hdla>
okay, i'll try --fake and then start from scratch later when that doesn't work
<jpdeplaix>
hdla: you can also edit manually the opam file (using « opam pin add -n coq-bignums [the latest version of coq-bignums] », then « opam pin edit coq-bignums »)
<hdla>
kakadu: how do i specify the version?
<kakadu>
`opam install coq.8.5` I think
<kakadu>
using dot
<kakadu>
The manual should be somewhere in the web
<hdla>
i couldn't find it in the man page
<hdla>
or, not easily :)
<hdla>
anyway, installation of coq-bignums failed. for some reason, it tried to install something globally, even though i'm not root
<hdla>
(the --fake install was successful, i used exactly the same versions as what's on the system)
ziyourenxiang has quit [Ping timeout: 240 seconds]
kamog has quit [Quit: Leaving.]
barcabuona has joined #ocaml
AltGr has left #ocaml [#ocaml]
dtornabene has quit [Quit: Leaving]
Haudegen has joined #ocaml
ygrek has joined #ocaml
hdla has quit [Quit: Leaving]
Denommus has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
jnavila has joined #ocaml
zv has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
barcabuona has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
jnavila has joined #ocaml
gpietro has joined #ocaml
gpietro__ has joined #ocaml
gpietro has quit [Remote host closed the connection]
sh0t has quit [Remote host closed the connection]
gpietro__ has quit [Remote host closed the connection]
Soni has quit [Ping timeout: 256 seconds]
sh0t has joined #ocaml
shakalaka has quit [Ping timeout: 248 seconds]
_andre has quit [Quit: leaving]
sh0t has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 240 seconds]
shakalaka has joined #ocaml
sh0t has joined #ocaml
Anarchos has joined #ocaml
cheater has joined #ocaml
<cheater>
hi, could someone remind me what the [< ... ] syntax is called in ocaml?
<cheater>
what's the name of this feature?
<Anarchos>
cheater extensible variant ?
Soni has joined #ocaml
<cheater>
thanks :)
<Anarchos>
cheater no idea, but it fits.
<cheater>
i wish haskell had extensible variants. this is probably the most fun basic feature in ocaml that i could easily see myself using in haskell
<Drup>
cheater: polymorphic variants
<Drup>
(extensible variants are something else ...)
<Drup>
I wouldn't call polymorphic variants "basic", though :)
<cheater>
oh what are extensible variants?
jimmyrcom has joined #ocaml
<cheater>
i'm talking about how you can just write a type as [< `Foo | `Bar ] and that's it, that defines the type constructors, in the same spot a value's type is described. that's nice and elegant.