<xutux>
Hello World! Does anyone know if their would be a problem with adding a special tag for unboxed/untagged arrays of int and records that are all ints similar to what is done with floats. Would their not be a big enough advantage to doing this to make worth while?
<pmetzger>
I don't know if it would be a problem, but recently I really wanted an array of unboxed bytes that wasn't a string.
<pmetzger>
(the sedlex stuff abuses strings that way "for efficiency" and I'd rather have something less ugly.)
<companion_cube>
the trend would rather be not to tag arrays at all
sh0t has joined #ocaml
<companion_cube>
but one can hope
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<Drup>
pmetzger: well, just use a module ? :)
<pmetzger>
You mean hide the use of strings inside a module?
<Drup>
module CharArray : sig type t .... end = String
<Drup>
Bytes*
<pmetzger>
Sure, but I'd still like something where you could do this with less mess.
<pmetzger>
It's gross.
<Drup>
using module abstraction is gross ?
<Drup>
We are not going to be friends :D
<pmetzger>
No, the fact that the underlying thing is supposed to be strings is gross.
<pmetzger>
The module stuff is what makes it smell much less.
<pmetzger>
Abstraction is excellent.
<pmetzger>
Gross hacks hidden by abstraction are better than gross hacks.
<pmetzger>
But best yet is not to have gross hacks. :)
<thizanne>
underlying things are supposed to be gross
<thizanne>
that's why they are underlying
<pmetzger>
Underlying things should be pretty too.
<pmetzger>
Everything should be nice. :)
<pmetzger>
Jewels all the way down. At least until you get to x86 machine code.
<pmetzger>
BTW, another thing I want is to figure out what to do about sedlex. Some people encouraged me to hack on it, but I got stuck getting feedback on my hacks. (this was months ago, I can't even remember what I did any more.)
<pmetzger>
I almost felt like I should fork it.
<pmetzger>
And I really need to pick people's brains on ppx stuff at some point. I really feel like I don't know what I'm doing when I use it. "Wow, I did this cargo cult thing and it worked! Glad it didn't fail because I'd have no idea what to do instead!"
<xutux>
companion_cube: Not to tag arrays? How so?
<Drup>
ugg, I think we should just seek active seedlex user and find a maintainer
<Drup>
I don't have time for it and I'm not an active user ...
<pmetzger>
I'm an active user.
<xutux>
Might as well make special cases for all primitive types; unboxed representations for arrays and records
<pmetzger>
But I can't maintain it without feedback.
<pmetzger>
Like I am too green. I need help understanding if I've done things right. So I'm probably a poor custodian.
<pmetzger>
But I might be the person who wants it fixed the most and I am willing to do stuff.
Haudegen has quit [Read error: Connection reset by peer]
<Drup>
pmetzger: yeah, I meant an experienced user. I will think about it.
<pmetzger>
I've felt like forking the thing and doing stuff on it anyway but that way seems mad.
<pmetzger>
What would be cool would be if someone more experienced would commit to be my sanity check and adviser, and then I'd happily do the day to day.
<pmetzger>
But I can't do without a sanity check and advice source.
<pmetzger>
Some things (like the lack of support for trailing context) have really caused me pain. :(
<pmetzger>
(By "commit" I mean actually read code I'm thinking of if I need a sanity check.)
AltGr has left #ocaml [#ocaml]
butterthebuddha has quit [Max SendQ exceeded]
<nicoo>
What is replacing mirage/jitsu ? (The repository is archived, so I assume it's deprecated)
butterthebuddha has joined #ocaml
jbrown has joined #ocaml
xutux has quit [Ping timeout: 264 seconds]
xutux has joined #ocaml
<Drup>
nicoo: I think it's simply that nobody updated the code after various mirage changes
ziyourenxiang has quit [Ping timeout: 264 seconds]
<nicoo>
Oh, could be
Onemorenickname has joined #ocaml
pmetzger has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 245 seconds]
sh0t has joined #ocaml
jbrown has quit [Ping timeout: 248 seconds]
pmetzger has joined #ocaml
gtrak has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
Haudegen has joined #ocaml
pmetzger has quit [Remote host closed the connection]
cbot has joined #ocaml
andreas_ has joined #ocaml
pmetzger has joined #ocaml
al-damiri has joined #ocaml
am55 has quit [Quit: am55]
am55 has joined #ocaml
zlsyx has joined #ocaml
xutux has quit [Ping timeout: 264 seconds]
kakadu has quit [Quit: Konversation terminated!]
Jfault has quit [Quit: EliteBNC - http://elitebnc.org (Auto-Removal: idle account/not being used)]
chat_ has quit [Read error: Connection reset by peer]
chat_ has joined #ocaml
<Leonidas>
dmbaturin: I am very confused why people even have license headers in their files. it seems meaningless.
navaja is now known as spew
chat_ has quit [Remote host closed the connection]
chat_ has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
<dmbaturin>
Leonidas: A bigger problem, as of me, is that a lot of time people don't have information in headers that would be genuinely useful if a sinle file ends up distributed separately, such as where the file is from and what it does. :)
<dmbaturin>
I do have this problem, too.
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
cmk_zzz has quit [Quit: leaving]
jnavila has quit [Remote host closed the connection]
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 264 seconds]
Haudegen has quit [Read error: Connection reset by peer]
pmetzger has quit []
Jesin has quit [Quit: Leaving]
dviper has joined #ocaml
tane has joined #ocaml
am55 has quit [Quit: am55]
Guest6886 has joined #ocaml
am55 has joined #ocaml
am55 has quit [Client Quit]
Guest6886 is now known as Haudegen
am55 has joined #ocaml
tarptaeya has quit [Quit: Leaving]
am55 has quit [Quit: am55]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
Haudegen has quit [Remote host closed the connection]
argent_smith1 has quit [Quit: Leaving.]
tane has quit [Quit: Leaving]
alicemaz has quit [Ping timeout: 276 seconds]
spew_ has joined #ocaml
spew has quit [Disconnected by services]
spew_ is now known as spew
sh0t has quit [Ping timeout: 255 seconds]
sh0t has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 252 seconds]
GreyFaceNoSpace has joined #ocaml
<GreyFaceNoSpace>
hi
<GreyFaceNoSpace>
can The Sieve of Eratosthenes be implemented with out the use of arrays in ocaml? because i am having trouble in doing so.
<thizanne>
the point of the sieve of erathosthenes is using arrays, so the answer would be no
sh0t has quit [Ping timeout: 245 seconds]
<GreyFaceNoSpace>
alright
<GreyFaceNoSpace>
but how would it be implemented in a purely functional language then?
<thizanne>
you can implement some similar algorithm that would « take the first prime candidate, it's actually a prime, remove its multiples from the candidates, do it again » with another data structure
<thizanne>
but the point of the sieve is precisely to use arrays to that the multiple removing parts is very efficient (to remove the multiples of n, you just do a for loop with a step of n, rather than going through a whole list testing divisibility)
<thizanne>
(and "removing" means "put the boolean to false")
<thizanne>
GreyFaceNoSpace | but how would it be implemented in a purely functional language then?
<thizanne>
sometimes you just need mutability for some algorithms
letoh has quit [Ping timeout: 268 seconds]
<thizanne>
some languages may try to hide it in a more or less convincing way
<GreyFaceNoSpace>
thizanne, i see
<GreyFaceNoSpace>
thizanne, i am really having trouble with ocaml
<GreyFaceNoSpace>
thizanne, i can't do anything the way i am used to it with imperative programming
bobajett has joined #ocaml
<thizanne>
you could also use a data structure that acts like a "persistent array", but for this particular algorithm you won't get the same performances
<GreyFaceNoSpace>
thizanne, any tips?
<thizanne>
yes, read some proper introductory course and practice
<thizanne>
and then practice again
<GreyFaceNoSpace>
thizanne, i am actually taking an introductory course
<GreyFaceNoSpace>
thizanne, wanted to try implementing some simple algorithms as practice
<thizanne>
if you're used to imperative programming (or mainstream object programming, which is essentially the same), it's normal if you feel destabilised
<GreyFaceNoSpace>
thizanne, got dijkstra to work after lots of struggle
<thizanne>
well implementing some algorithms is a nice idea
<thizanne>
but erathosthenes just happens to be one that poorly adapts to pure functional programming
<GreyFaceNoSpace>
thizanne, ah i see
<thizanne>
another thing you could do is go reading the documentation of the List module and reimplement the functions
<GreyFaceNoSpace>
thizanne, bad choice then :D
<GreyFaceNoSpace>
thizanne, i did that :)
zolk3ri has quit [Remote host closed the connection]
<thizanne>
good
<thizanne>
you should consider asking for review if you didn't, to your teacher or on discuss.ocaml.irg
<thizanne>
.org
<GreyFaceNoSpace>
thizanne, i have trouble with implementing algorithms that are iterative in nature
<GreyFaceNoSpace>
one more question
<GreyFaceNoSpace>
thizanne, i feel that my code is very unclean
<GreyFaceNoSpace>
thizanne, like really messy
<GreyFaceNoSpace>
and i don't know how to fix it....an resources i can read. i feel like i need to read some good code
<GreyFaceNoSpace>
so i can try to learn
<bobajett>
hello, I have a very basic (absolute beginner) question. I'm on the first chapter of Real World Ocaml and have setup Emacs/Tuareg/Merlin. I'm trying to eval a buffer with just this one line: let result = String.lowercase_ascii "Superman".
<bobajett>
but when I eval it I get: Error: Unbound value String.lowercase_ascii
<Enjolras>
infinity0: no example.Used to write bindings using ctypes + rust cheddar going through C but it's a bit slow and rust cheddar is unmaintained
<Enjolras>
infinity0: but now there is this lib https://docs.rs/ocaml/0.3.5/ocaml/ so you can write stubs in rust just ike you would do with C
<thizanne>
bobajett: which version of ocaml ?
<bobajett>
Welcome to utop version 2.0.2 (using OCaml version 4.06.0)!
<Enjolras>
infinity0: though that's not super convenient, so i've been working on a rust macros to generate the cruft automatically