Emmanuel` has quit [Quit: Konversation terminated!]
Algebr` has joined #ocaml
m-x-v has quit [Ping timeout: 264 seconds]
<Algebr`>
seangrove: I'm not sure about the Thread module in general, haven't really used it ever.
<aantron>
Algebr`: i dont believe seangrove is here at the moment
<Algebr`>
ah
orbifx has joined #ocaml
<orbifx>
Hey I know this off-topic, but is anyone looking to start a blog? or convert their existing?
<orbifx>
I'm looking for users for one I've written. Doesn't use OCaml yet, but I'm planning to write its extensions in OCaml.
<Algebr`>
I just switched blogs, missed by like 2 weeks
<orbifx>
:(
<orbifx>
maybe you are still on the move?! :P
<orbifx>
skip town :P
<Algebr`>
lol
<orbifx>
which one did you go for?
<Algebr`>
hakyll
<orbifx>
fair enough.. that was my previous one
<Algebr`>
I am using someone else's setup, but now I am stuck with a haskell coding problem for which I can't solve.
<orbifx>
What is the problem?
<Algebr`>
It is including all my posts in my atom.xml but I only want the OCaml tagged blog posts to show up in atom.xml, I can't seem to solve it mainly because it would require me to learn more haskell/hakyll which I don't have time for.
<Drup>
that's rather trivial in jekyll
manizzle has quit [Ping timeout: 248 seconds]
<Drup>
(I use jekyll only because I use the auto-thingy in github pages. Otherwise, it's rather bad)
<orbifx>
Algebr`: Yeah.. I can't readily help with that. Maybe if you pasted a snipped of the atom generator..
<orbifx>
But I think hakyll is more of a toy for haskellers, a way to get some haskell into putting a blog together (nothing wrong if that is what you want).
<orbifx>
My blog generates different feeds for each topic, and one grand feed for all posts.
<orbifx>
Hmm.. maybe I should add a filter in the feed generator to allow limiting which topics have feeds ... /me thinks..
<Algebr`>
I used octopress, a jekyll deriviative, before this, then a org-mode thing and now hakyll. Its rathering annoying I can't get this to do what I want.
<orbifx>
can I dare say you try mine?! :P
<orbifx>
shameless promotion
<orbifx>
it's just bash (a bit of awk somewhere) but uses files and pipes to form a system
<Drup>
That sounds like something I'm very excited not to use.
<orbifx>
my intent is to have any part replaceable by other programs or scripts.
Armael has joined #ocaml
<orbifx>
Drup, I'm using bash as "glue logic". Ok, I've stretched it a little out of interest and educational reasons, but going forward the sub-programs will written in Ocaml. But other's can use their own and substitute them.
<Algebr`>
hmm, no I like hakyll cause it comes with a binary that deploys and knows file system events, etc. Plus this one is already CSSed and nicely formatted, etc. sadly no OCaml blog thing exists, stog was icky to me.
<orbifx>
For example you can change the markdown to html converter with one you prefer.
<Enjolras>
There is also stog in ocaml
<Enjolras>
ah :)
<Drup>
orbifx: Seriously, an unholy mix of bash and awk and pipes would be the last thing I want to fiddle with to add a feature when I need it. Especially since, given that you just made it, it has probably 2% of jekyll's features
<Drup>
(I don't even like jekyll, but if you want to write blog posts, just write them, don't write blog engines ..)
<orbifx>
Been at it for a year, but yeah, it safe to pressume it doesn't have the same feature set
<orbifx>
And bugs.
<orbifx>
Thus the call for help.
struk|desk|away is now known as struk|desk
<Algebr`>
if you can read .markdown files then I'll give it a try
<Drup>
(Funnily, there is a similar saying about game engines in the gamedev community)
<orbifx>
But I have to say, the user shouldn't have to meddle with bash. It's meant to be a data driven system rather than a code driven one.
<orbifx>
Algebr`: are you using Linux? In particular Arch?
<Algebr`>
I'm on ubuntu 15
<Armael>
just curious, what didn't you like about stog, Algebr`?
<Drup>
The markup ? :D
<Armael>
idk, can't you write your stuff in markdown?
<orbifx>
Algebr`: I need to make a deb package at some point. I have made an AUR package.
<Armael>
my only interaction with stog was writing gagallium blog posts, with gasche as a proxy
<Algebr`>
I'm done with gentoo/arch/friends. when it came to copying my styling from previous work it wouldn't take it since it meant having to know how the html would look like but that woudl be hard because it was generating it
<Enjolras>
Armael: i think it uses xml
<Drup>
Armael: it's very badly integrated, you have to stuff your markdown inside an xml node, you can't extend it at all and it supports very few extensions
<Algebr`>
And so yes, I could have spent time learning it but didn't want to spend time on what should be easy
<Armael>
I think gasche plugged pandoc to render the markdown
<Armael>
but I guess it's an hackish solution?
ygrek has quit [Ping timeout: 240 seconds]
<Drup>
That is a very nice understatement
<Armael>
meaning?
<Algebr`>
1 guy made it so it shows, whereas hakyll has 90 contributers and jekyll probably hundreds, so those frameworks are more varied in solutions and ways of doing things
<Algebr`>
not a criticism, just an observation
<orbifx>
I dare say they all have a particular attitude which is both an advantage and disadvantage: they structure their system as a framework.
<orbifx>
Everyone guns for frameworks..
silver has quit [Read error: Connection reset by peer]
hxegon has quit [Quit: BRB]
<orbifx>
Algebr`: if you try it, query me for any questions :D
Reshi has quit [Ping timeout: 244 seconds]
<Algebr`>
was merlin renamed from ocamlmerlin to merlin?
<Algebr`>
or something like that
<Algebr`>
hmm, I'm going to start all programs with open StdLabels
orbifx has quit [Quit: WeeChat 1.4]
orbifx has joined #ocaml
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
ril has joined #ocaml
murphy- has quit [Quit: leaving]
orbifx has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 268 seconds]
<Algebr`>
are there any gotchas between side effects and partial func application
ril is now known as ril[away]
ril[away] is now known as ril
tennix has quit [Ping timeout: 252 seconds]
Emmanuel` has quit [Quit: Konversation terminated!]
sh0t has joined #ocaml
Emmanuel` has joined #ocaml
Emmanuel` has quit [Client Quit]
Emmanuel` has joined #ocaml
FreeBirdLjj has joined #ocaml
<aantron>
what qualifies as a gotcha?
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
<aantron>
depending on how the function is defined, there may be side effects after only some arguments are applied
<def`>
Algebr`: no, the binary has always been ocamlmerlin
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
idegen has joined #ocaml
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ril has joined #ocaml
john51 has quit [Ping timeout: 260 seconds]
john51 has joined #ocaml
sh0t has quit [Ping timeout: 250 seconds]
Fistine has joined #ocaml
jeffmo has quit [Quit: jeffmo]
ril is now known as ril[away]
<tobiasBora>
Hello,
<tobiasBora>
I would like to know, I have Gb of data to write in a file. What is the best way to do so ?
<tobiasBora>
Is output_string more efficient than Printf.fprintf ?
<tobiasBora>
If I have a lot of small strings to write, should I first concat them in a bigger string, then write it, or write all the little peace of code ?
pyon has quit [Quit: fix config... attempt 43285496253215]
pyon has joined #ocaml
tennix has joined #ocaml
<def`>
channel will do the buffering
<def`>
output_string is the simplest efficient way
<tobiasBora>
def`: Ok. But buffering cannot be a good thing for efficiency ? (I don't know, it may want to deal with cache...)
<tobiasBora>
I tried, and it seems to be better to use output_string with small string rather than concat them before.
<def`>
?!
yunxing_ has quit [Remote host closed the connection]
<def`>
buffering is about trading latency for more throughput, so yes it is a good thing for efficiency
yunxing has joined #ocaml
yunxing has quit [Ping timeout: 240 seconds]
ril[away] is now known as ril
<tobiasBora>
def`: Oh... You mean that output_string uses channel, so it also has lattency ?
struk|desk is now known as struk|desk|away
<def`>
it has buffering.
<def`>
if you don't explicitly flush, you will get more latency, but also more throughput.
<def`>
if you care about efficiency this is the way to go.
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
<tobiasBora>
def`: Buffering yes sorry. Ok great thank you !
ril is now known as ril[away]
sh0t has joined #ocaml
Reshi has joined #ocaml
struk|desk|away is now known as struk|desk
yunxing has joined #ocaml
Emmanuel` has quit [Quit: Konversation terminated!]
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
Emmanuel` has joined #ocaml
yunxing has quit [Ping timeout: 276 seconds]
wolfcore has quit [Ping timeout: 248 seconds]
Emmanuel` has quit [Quit: Konversation terminated!]
jeffmo has joined #ocaml
Emmanuel` has joined #ocaml
wolfcore has joined #ocaml
Tamae has joined #ocaml
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
idegen has quit [Quit: Leaving.]
johnelse has quit [Ping timeout: 268 seconds]
larhat has quit [Quit: Leaving.]
johnelse has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
_whitelogger_ has joined #ocaml
_whitelogger has quit [Remote host closed the connection]
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
abbiya has joined #ocaml
Reshi has joined #ocaml
hxegon has joined #ocaml
sh0t has quit [Ping timeout: 268 seconds]
yawnt has quit [Ping timeout: 264 seconds]
yawnt has joined #ocaml
yunxing has joined #ocaml
keep_learning has joined #ocaml
ril has joined #ocaml
struk|work has quit [Ping timeout: 252 seconds]
MercurialAlchemi has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Reshi has quit [Ping timeout: 240 seconds]
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
kushal has joined #ocaml
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
<Algebr`>
has anyone done bindings to readline
struk|desk is now known as struk|desk|away
<Algebr`>
wonder if anyone would benefit if such a thing existed
Reshi has joined #ocaml
<adrien>
isn't there lambdaterm which can provide something too?
<adrien>
in any case there's the licensing issue with readline (gpl)
<adrien>
and there is at least one similar lib which name I've forgotten ='(
<adrien>
ledit
Sorella has quit [Quit: Connection closed for inactivity]
<larhat>
should the library the sole purpose of which is to generate code, incur such a big penalty? or maybe I'm using it wrong? I've tried to use ppx-driver based binary rewriter, but then it's complaining about other extensions (`new%js`, provided by `js_of_ocaml`). What the preferred way to use several ppx extensions?
gargawel_ is now known as gargawel
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
kushal has quit [Quit: Leaving]
yunxing has quit [Ping timeout: 252 seconds]
johnf has quit [Remote host closed the connection]
<companion_cube>
the opam freeze is quite annoying, I have to release something today... :?
<companion_cube>
:/
Anarchos has joined #ocaml
<Anarchos>
I finally managed to install opam on HaikuOS :)
copy` has quit [Quit: Connection closed for inactivity]
<Anarchos>
Anyway i need to add «LC_CTYPE=C» in each command line where ocaml is used. Otherwise it complains about "Generated bytecode executable cannot be run on 32-bit platform""
jwatzman|work has joined #ocaml
sepp2k has joined #ocaml
larhat has quit [Quit: Leaving.]
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
destrius has joined #ocaml
malc_` has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
warp has joined #ocaml
lobo has quit [Quit: WeeChat 1.4]
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
BitPuffin has joined #ocaml
octachron has joined #ocaml
Reshi has joined #ocaml
Reshi has quit [Client Quit]
Reshi has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
lobo has joined #ocaml
Haudegen has joined #ocaml
tg has quit [Ping timeout: 240 seconds]
tg has joined #ocaml
tg has quit [Excess Flood]
_andre has joined #ocaml
tg has joined #ocaml
tg has quit [Excess Flood]
darkf has quit [Quit: Leaving]
tg has joined #ocaml
tg has quit [Excess Flood]
Slice^ has joined #ocaml
Slice^ has quit [Max SendQ exceeded]
tg has joined #ocaml
tg has quit [Excess Flood]
Slice^ has joined #ocaml
tg has joined #ocaml
tg has quit [Excess Flood]
tg has joined #ocaml
tg has joined #ocaml
tg has quit [Excess Flood]
silver has joined #ocaml
Reshi has quit [Ping timeout: 240 seconds]
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
Emmanuel` has quit [Client Quit]
Emmanuel` has joined #ocaml
Slice^ has quit [Quit: Leaving]
Kakadu has joined #ocaml
dhil has joined #ocaml
d0nn1e has quit [Ping timeout: 244 seconds]
d0nn1e has joined #ocaml
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
kushal has joined #ocaml
larhat has joined #ocaml
Algebr`` has joined #ocaml
rks`_ has joined #ocaml
jpdeplaix1 has joined #ocaml
TheAuGingembre has quit [Ping timeout: 240 seconds]
jpdeplaix has quit [Ping timeout: 240 seconds]
rks` has quit [Ping timeout: 240 seconds]
Algebr` has quit [Ping timeout: 240 seconds]
nzyuzin has quit [Ping timeout: 240 seconds]
jyc has quit [Ping timeout: 240 seconds]
averell has quit [Ping timeout: 240 seconds]
phrst has quit [Ping timeout: 240 seconds]
phrst has joined #ocaml
ggole has joined #ocaml
nzyuzin has joined #ocaml
malc_ has joined #ocaml
rks`_ is now known as rks`
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
TheAuGingembre has joined #ocaml
jyc has joined #ocaml
lobo has quit [Quit: WeeChat 1.4]
julien_t has quit [Ping timeout: 248 seconds]
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 276 seconds]
freehck has joined #ocaml
octachron has quit [Quit: Leaving]
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
Haudegen has joined #ocaml
idegen has joined #ocaml
rvp has joined #ocaml
Sorella has joined #ocaml
averell has joined #ocaml
<Maelan>
someone asked if there was a mean to write a hashtable “statically”
<companion_cube>
you mean to write a literal hashtable in the code?
<Maelan>
that is, a syntax to initialize a hashtable directly in a given state
<Maelan>
yes, something like that
<Maelan>
like [| |] for arrays
aantron has joined #ocaml
<ggole>
Nope.
<Maelan>
(although i am not sure if [| |] is actually optimized for static initialization)
<ggole>
A reasonable alternative is to write tbl_of_alist and then tbl_of_alist [k0, v0; k1, v1; ...]
<ggole>
[||] constructs a fresh array each time.
<companion_cube>
I would indeed write/use a `hashtbl_of_list` and then `let tbl = hashtbl_of_list [1, "1"; 2, "2"; ....]`
octachron has joined #ocaml
<Maelan>
ggole, even for something like « let global_array = [| 1 ; 2 ; 3 |] » at the toplevel?
<ggole>
Yeah
<companion_cube>
well this array will be evaluated only once
<Maelan>
that’s sad
<ggole>
Immutable constant objects will be statically initialized
<companion_cube>
why so?
<ggole>
But not arrays
<companion_cube>
ah yeah, it's evaluated at initialization time
apluke has joined #ocaml
<Maelan>
but not too heavy to compute, i guess
<ggole>
It might make the GC a bit simpler
<zozozo>
Maelan: i think the problem would be if you do something like : let global_array = [| (print_string "hello"; 1); 2 |]
<companion_cube>
zozozo: also valid if you have a static list...
<ggole>
Don't have to make the write barrier support mutations to .data segments
<zozozo>
companion_cube: right
lobo has joined #ocaml
<flux>
could be an additional attribute that requires the data to be compile-time constants ;)
Emmanuel` has quit [Quit: Konversation terminated!]
<flux>
it would be nice to be able to embed binary data efficiently in ocaml binaries
Emmanuel` has joined #ocaml
<flux>
btw, how about strings?
<flux>
I'm confident it would be considered for inclusion should someone write that functionality ;)
<Maelan>
yes, more generally speaking, my question was about whether the compiler has any form of optimizing compile‐time constants
<ggole>
Compile time constants isn't enough (unless flambda changes things): they have to be syntactically constant
<ggole>
eg, the first cons of [(print_int 1; 1); 2; 3] will be allocated even though it could be a constant
<flux>
ggole, well, ocaml doesn't really have the concept of compile time constant like C++ does I think..
<flux>
so we get to define it just as we want :)
<flux>
ocaml is a dynamic language, all values are runtime \o/
<ggole>
Maelan: structured constants like lists are statically initialized
<Maelan>
by the way, what is flambda? i keep seeing this name
<Maelan>
ggole, but not arrays?
<ggole>
Arrays are never constant. They are mutable and have identity.
<companion_cube>
arrays are mutable, I suppose it's more complicated
<Maelan>
ah, oh, i see
<Maelan>
thus the advice for hashtbl_of_list
<Drup>
ggole: flambda changes things
<flux>
btw, given there's an 4.03 beta switch in opam, is it configured to compile with flambda?
<ggole>
Strings are a bit of a special case: they are mutable and have identity, but are not allocated each time though
<Drup>
flux: no, it's very annoying
<flux>
drup, is there an easy way around it?
<malc_>
ggole: plus there's -safe-string
<flux>
almost the whole point of 4.03 beta branch IMO would be testing flambda :)
<Enjolras>
"what is flambda ?" - " flambda changes things". Good definition for a compiler backend representation tailored to support code transformations passes :D
<ggole>
But that's in the process of changing, which is good
<ggole>
Since mutable string literals is a revolting idea
<companion_cube>
Drup: but the final release will have flambda, I hope?
<flux>
drup, ok, so there's 4.03.0+flambda
<Drup>
afaik, it's not by default
<Drup>
companion_cube: it's quite annoying
<flux>
readling from the mailing list I think it's not going to be on by default
<flux>
it's going to maybe be by default on 4.04
<flux>
I guess that's OK. advanced users get to switch to flambda if they wish.
<flux>
ie. people prepared to deal with potential issues
<flux>
not unsuspecting "regular" ocaml users ;-)
<Drup>
I think it should be by defualt
<Enjolras>
Could you switch to flambda on a per module basis ? Or the objects won't be compatibles ?
<Drup>
Enjolras: the later
<Enjolras>
arf. This is annoying. A gradual conversion would be easier
<Maelan>
thanks Enjolras :-)
<ggole>
Wait, does it really change representations (of closures, I assume)?
<companion_cube>
I don't see the point of not making it by default
<companion_cube>
but well, I'm not a maintainer
julien_t has joined #ocaml
<flux>
enjolras, how would it be easier? it should be invisible to the user anyway?
<Enjolras>
companion_cube: i for one, strongly appreciate not to have to debug compiler bug after deploying something in prod
<companion_cube>
yeah, yeah, but no one is going to test flambda if it's not enabled
<flux>
I think it's ok that features involving rewriting large bodies of code and that might subtly break stuff get to stay on the shelf for the duration of one release cycle.
<Enjolras>
companion_cube: this is quite good to have opt-in, so that you can switch to 4.03 and smoothly tests flambda in a contained environment
<flux>
companion_cube, I think you're underestimating the number of people wishing to test it..
<Drup>
flux: it has been tested quite a lot ...
<flux>
companion_cube, because it's an exciting fature
<companion_cube>
if it's a compiler-compile-time switch, then people will have to choose flambda or not when they install OCaml, right?
<Drup>
all the big ocaml softwares run on it
<flux>
drup, well not even all of opam compiles with 4.03 out of the box so I doubt it.. ;-)
<flux>
(due to dependencies)
<companion_cube>
(grr oasis)
rvp has quit [Ping timeout: 250 seconds]
<Drup>
flux: actually, they do, not all of the patches have been mainlined
<Enjolras>
companion_cube: i guess since the objects are not compatibles, you need two ocaml installations and two switches
<companion_cube>
so there will be 2 releases? ohmy.
<flux>
enjolras, opam deals with that kind of stuff so it shouldn't be that much of an issue?
<Enjolras>
flux: how ? I don't see how without a switch ? Unless you duplicate all the packages
<flux>
enjolras, exactly, with a switch :)
<companion_cube>
ppx_deriving doesn't install on my 4.03.0+beta1
<flux>
enjolras, it's easy to manage I think
<Drup>
companion_cube: patched in master, iirc
<Enjolras>
companion_cube: yeap. I tried to install 4.03 beta, it failed, didn't check further
<Drup>
I mean, nobody is doing the 4.03-compatible releases because people are waiting to be sure there are no other breaking things ...
<Enjolras>
i know how to use opam ;)
<companion_cube>
I hope the flambda switch also comes with ocamlnat enabled, so we can play with the toplevel :D
<flux>
companion_cube, amazingly good point!
<flux>
btw, when does someone write a disassembler for ocaml toplevel?-)
<Enjolras>
why do you need this ?
<ggole>
The toplevel already supports dumping intermediate code
<flux>
it'd be neat to write a function and then check how it gets optimized
<companion_cube>
I'd want utop-nat actually
<companion_cube>
(is it christmas yet?)
<flux>
ggole, all interesting stuff is visible at that level?
<Enjolras>
flux: can't you just dump cmm ?
<ggole>
The native compilation pipeline is not supported
Emmanuel` has quit [Quit: Konversation terminated!]
<flux>
enjolras, you can get to the data via compilation, but ocamlnet doesn't produce any files..
Emmanuel` has joined #ocaml
<flux>
(does it?)
<Enjolras>
ha, no, -dcmm doesn't exist
<Enjolras>
stops at -dlambda
<ggole>
Yep, cmm is part of native code generation, which is not supported in the toplevel.
<ggole>
You can print the output of any stage of the bytecode pipeline.
<Enjolras>
ggole: ocamlopt could have supported -dcmm
<Drup>
Enjolras: it does
<companion_cube>
utop doesn't have -dlambda :(
<ggole>
It does?
<Enjolras>
ah yes, it does. Dumb me, i typed ocamlc
hxegon has joined #ocaml
<Enjolras>
good luck reading this though. After -dlambda my brain melts
<Drup>
-dflambda is readable
* ggole
has an emacs shortcut for producing an assembly listing of the current file
<Enjolras>
i would expect this, but is it printed before or after the optimisations passes Drup ?
<Drup>
Enjolras: both
struk|desk|away is now known as struk|desk
<Enjolras>
nice
<companion_cube>
I still want merlin to be able to print the flambda corresponding to the selected code :]
<companion_cube>
(and a poney, too)
<companion_cube>
pony*
<Enjolras>
honestly guys, how often are you going to bother with that ?
<Drup>
Not very often :p
<companion_cube>
hey I don't know
<Drup>
I will put [@inline] and trust the compiler
<companion_cube>
sometimes you trust, but verify
<Enjolras>
i would guess once a year. When i get a very hot loop
<Drup>
(well, and measure before, ocf)
<Enjolras>
companion_cube: go back writting C
tane has joined #ocaml
<ggole>
I bother with it every time I am curious, which is very often
<companion_cube>
Enjolras: the code I write doesn't have a single bottleneck, so I'd better optimize everything
<Drup>
I do use -dsource a lot, though
sz0 has joined #ocaml
<Enjolras>
80% of my optimisation work is removing allocations
<ggole>
(And sometimes to spot specialisation problems in hot code.)
<Enjolras>
maybe the code I write is quite specific, but usually it's the bottleneck
<Enjolras>
now, i understand flambda can help with that for closures, but i would say just put [@inline] when you see a hot closure and be done with that once you tested and saw it made a difference
<Drup>
Enjolras: that's what I intend to do :p
<Enjolras>
:)
<Enjolras>
correction: 80% of my optimisation work wich is not algorithmic is removing allocations*
<Enjolras>
this is actually something i realized recently. If you make your code twice slower but improve the allocation rate asymptotically (like (O(N) -> O(lg N)) you can still get a 30% perf improvment
<flux>
a long time I ago I wrote an X clock application to run on a pentium with 60 fps full screen
<flux>
basically the loop was 1) find out a convex hull of the drawing 2) cover it with nicely-sized redraw region boxes 3) update 4) loop
<flux>
it spent easily most of the time in the GC :)
<flux>
when actually it could have just discarded everything it allocated on each loop round. adjusting gc parameters made it run that 60 fps :).
<companion_cube>
what parameters did you pick for the GC?
<flux>
I don't remember, but IIRC it was about increasing minor heap size
<ggole>
Mmm. Stuff that spills out of the minor heap is way more expensive to collect.
<companion_cube>
but if all values are short-lived...
<Enjolras>
tweaking minor heap helps in this case, but not when you are going to alloc 15GB of memory and release it just after
<Enjolras>
and cycle
<Enjolras>
you could have a 20GB minor heap, but duh, fragmentation alert. Java alert.
<Drup>
Enjolras: according to people who worked with 200+Gb RAM, it actually works fine
<Enjolras>
Drup: i don't doubt it works. But it will increase the memory usage
<Enjolras>
Now, if you're going to use 200GB, you can afford wasting a few GB
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
NingaLeaf has joined #ocaml
dhil has quit [Ping timeout: 276 seconds]
<Maelan>
back to this constant hashtable story
sh0t has joined #ocaml
<Maelan>
i said to the asker that the only solution if he really wanted to avoid the cost of constructing the table was Marshal
<Drup>
I wouldn't be surprised if that was handled by flambda
<Drup>
huum, hashtable, probably not
<Drup>
Map is definitly better
<Maelan>
the difference between Map and Hashtbl is immutability, right?
<haesbaert>
not only that, one is a tree and the other is a hash :D
<Drup>
yes
struk|desk is now known as struk|desk|away
<Maelan>
hm, i assume Hashtbl has better access time in practice, then?
<Enjolras>
depends on the cost of hashing
<thizanne>
depends, but it does
tg has joined #ocaml
<flux>
with fast hashes I guess Hashtbl is easily (?) faster. but I like Maps predictibility and immutability.
<flux>
I mean, there's no obscure corner case that's going to blow Map's runtime :)
<flux>
I don't know if some ocaml library implements Hashtbl with Map buckets
<companion_cube>
Core does
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
<companion_cube>
Hashtbl is very fast for lookup is your hash is decent
tennix has joined #ocaml
<companion_cube>
(for instance, Hashtbl.Make() on int is very very good)
<flux>
I guess I've just not yet found a case where mapping values would be the bottle neck
<companion_cube>
well my algorithms have hashtables everywhere, so they would be a bottleneck if they were slow
<zozozo>
same for me
<companion_cube>
oh strange ^^
<companion_cube>
how*
<thizanne>
companion_cube: did you try a persistent version with hamt ?
shinnya has joined #ocaml
<companion_cube>
yes, I do benchmark against HAMT
<companion_cube>
it's pretty decent, but not as fast
<companion_cube>
(I think it's still better than Map on lookup when the size grows)
<companion_cube>
(but insertion is much slower)
<thizanne>
i've had strange results with insertion, real life benchmarks are really useful
<haesbaert>
just to be clear, say my tree has 100 members, I insert on the smallest one, (no rebalancing therefore), insert will take roughly "50" operations ?
FreeBird_ has quit [Ping timeout: 248 seconds]
nicholasf has quit [Ping timeout: 240 seconds]
<haesbaert>
not accounting for the log cost for finding where to place it
<haesbaert>
ah I see it now, disregard my question.
<thizanne>
(almost exactly) 3 years rks`
<rks`>
yep
<companion_cube>
well, 15~20% increase in perf would be huge
<companion_cube>
assuming an assembly primitive for popcount
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
nicholasf has joined #ocaml
pierpa has quit [Ping timeout: 264 seconds]
rvp has quit [Ping timeout: 240 seconds]
jgjl has joined #ocaml
dhil has joined #ocaml
<flux>
companion_cube, pretty fun :)
<flux>
didn't know there was a pretty printer for Parsetree.expressions, pretty nifty
<flux>
of course, I know nothing of ppx development anyway :)
<flux>
and the related ppx_rule is pretty nice as well
<flux>
too bad you need to be suuuuper careful to write useful rules ;)
<j0sh>
speaking of hashtables/maps/etc. i'd like to write an interpeter to evaluate SQL-like queries, maybe wih olinq or similar. i'm not sure how to represent each row of data though... objects are really nice in theory because of field safety (and row polymorphism) and faster-than-hashtbl lookups, but not sure how to use ocaml objects here without having to go through a separate compile step after parsing/emitting. are hashtables or maps my only option he
<companion_cube>
anything that relies on types would need to go through the type checker, I think
<Algebr``>
ggole: where is that emacs snippet for the assembly thing you mentioned
<companion_cube>
if you want something flexible, give up on types and use some kind of generic table representation
<j0sh>
...or implement my own type checking. but it'd still have to be a table representation, right?
<companion_cube>
(something like: type data = I of int | S of string | F of float type table = data array array)
<companion_cube>
yeah, indeed
<companion_cube>
hmm, type table = { headers: string array; row: data array array; }
<companion_cube>
something like pandas in python, in other words
<companion_cube>
(if you're interesting in OLinq we can discuss; I can make a release, too)
<companion_cube>
if you write a general-purpose table representation, you can integrate it in OLinq if you wish so
<companion_cube>
(currently it mostly relies on iterators...)
<companion_cube>
another possibility is to have your own DSL but use in-memory Sqlite for actual execution
<j0sh>
interesting, i'll have to read up more on indexed sets
<j0sh>
yeah, parsing and emitting actual SQL was another option i've been thinking of
<j0sh>
(technically don't even have to parse anything if the dsl *is* SQL, but sqlite doesn't have a lot in the way of safety features...)
<j0sh>
and theres still ocaml (jsoo) interop on top of that
<companion_cube>
oh, you want a query engine for jsso
<companion_cube>
jsoo
<j0sh>
yeah, so users can munge their own data for reporting, basically
<companion_cube>
then indeed sqlite is out
<j0sh>
was hoping to write a pipeline kind of thing, with some data in, some SQL munging, then a graph/table/pdf/etc output
<companion_cube>
but you still want a SQL-like syntax?
<j0sh>
the backend is actuall sqlite and i'm not opposed to shipping the query back to the server, but a little concerned about safety and pathological performance
<companion_cube>
well for a generic graph/table/... output, anyway you'll have to have a generic table representation, I believe
<Algebr``>
what is pathological performance
<companion_cube>
performance that makes you sick
<j0sh>
yeah, corner cases (whether intentional or not) that just kills perf
<j0sh>
which is a concern here with user input
<companion_cube>
who are your users?
<companion_cube>
(that is, do they know SQL, OCaml…)
<j0sh>
nope, they'll be fairly non technical :) it's mostly so I can write quick reporting scripts for them, and ideally give them the option to modify to taste
<companion_cube>
sounds difficult :p
<j0sh>
so it's a way to get some customizability in without hard coding (and possibly recompiling) everything for every customer
<j0sh>
i have like a dozen iterations of the SQL-like DSL... gone through a million representations, row and column major, cclinq based, object based, etc
<companion_cube>
now I want to write a generic table representation -_-
orbifx has joined #ocaml
<orbifx>
How can one do fold_left on a Pervasives.String?
tennix has quit [Ping timeout: 246 seconds]
<Algebr``>
maybe string into list, then fold_left, easy way.
<zozozo>
orbifx: String.iter with a ref to the accumulator ?
<companion_cube>
CCString.fold
<companion_cube>
:p
<Algebr``>
companion_cube: I'm very tempted to start digging into containers, use it for real stuff.
<orbifx>
zozozo: I'm interested in a functional non-mutable way
slash^ has joined #ocaml
sh0t has quit [Ping timeout: 250 seconds]
<orbifx>
companion_cube: CCString oO
<orbifx>
Companioncubestring? :-P
<companion_cube>
nahhhhh
<companion_cube>
it's part of containers :p
<zozozo>
well, you can code one such as : let fold f acc s = let rec aux f s acc i = if i > String;length s then acc else aux f s (f acc s.(i)) (i + 1) in aux f s acc 0
<Algebr``>
[] not ()
<zozozo>
yeah, i always confuse string and array acesses, :p
<Anarchos>
why is work on multicore so slow ?
<orbifx>
Algebr``: I'd like to avoid the cost, because it's not a one-off conversion
<haesbaert>
Anarchos: I'd guess it has something to do with being incredibly hard
<orbifx>
companion_cube: I've got a String returned by Cstructs, would that work with CCString?
<Anarchos>
haesbaert: i was just afraid it was abandoned...
<orbifx>
Anarchos: it's because they are using single core :-P
<companion_cube>
orbifx: I don't know, is the type `string`? or is it a bigarray?
<orbifx>
String, I'm calling to_string. Can use the bigarray if it's better
<companion_cube>
not necessarily, unless you really worry about perf
copy` has joined #ocaml
<companion_cube>
so yes it should work without any problem, CCString is about regular strings
<orbifx>
Is it an extension? Or does it copy?
sh0t has joined #ocaml
<Algebr``>
wow, order of CSources matters to oasis
<Algebr``>
or rather to the compilers
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
<companion_cube>
orbifx: it's an extension, but I'm not sure what you mean
<Algebr``>
I think he meant to the string itself
<companion_cube>
ah, I suppose Cstruct.to_string must copy, since internally I believe it's a bigarray
<Algebr``>
its ocaml....so copy copy copy
<companion_cube>
orbifx: it's in cstruct.mli, in the doc of to_string
<Algebr``>
orbifx: are you using merlin
<companion_cube>
whereas to_bigarray preserves sharing of the underlying array
<orbifx>
Algebr``: no I'm not using it.
<companion_cube>
(then if you use to_bigarray, there is this bigstring library that provides fold... ;)
<Algebr``>
orbifx: use merlin, latest merlin has the doc strings pop up when you use a function, very handy.
<Algebr``>
companion_cube: I'm confused about use of bigstring, why use bigstring over cstrut
<Algebr``>
cstruct
<orbifx>
companion_cube: bitstring is part of your library?
<companion_cube>
no reason here, cstruct already provides a fold actually
<companion_cube>
orbifx: it's a small library on opam
Anarchos has quit [Quit: Page closed]
<orbifx>
companion_cube: what I meant by extension vs copy, an extension could work on the existing types vs needing to copy-convert first
<companion_cube>
well, CCString works on regular strings, no need to copy
<orbifx>
companion_cube: the fold provided by Cstruct needs some kind if iter
<companion_cube>
ah right
<companion_cube>
I don't really get Cstruct.iter's signature
<companion_cube>
ah ok, it iterates on chunks
<orbifx>
Algebr``: might invest in merlin at some point. My problem is the lack of documentation by Cstruct. Like a high level explanation
<companion_cube>
well `Cstruct.to_bigarray c |> Bigstring.fold f acc` should do the trick
<orbifx>
I didn't get that signature well either. I thought I understood what the code does, but I don't want to risk it.
<Algebr``>
risk what ?
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
<orbifx>
Using a function I *think* I know what it does.
<Algebr``>
then many programmers are big gamblers? lol
<orbifx>
Lol
<orbifx>
Depends how close the deadlines are I guess :-P
<sspi>
octachron: thanks for the advice yesterday I solved it a bit different though, by using pattern matching instead
<orbifx>
Comp
<orbifx>
companion_cube: I get an exception, index out of bounds
lobo has quit [Quit: WeeChat 1.4]
nicholasf has quit [Ping timeout: 240 seconds]
<Algebr``>
means you're indexing something out of bounds
<Algebr``>
check your .() or .[]
<orbifx>
I know. Although I don't make any such calls
struk|desk is now known as struk|desk|away
Haudegen has quit [Ping timeout: 248 seconds]
rwmjones is now known as rwmjones_hols
Emmanuel` has quit [Quit: Konversation terminated!]
<seangrove>
In case anyone feels like they don't have enough to do, I wouldn't mind advice on how to 1.) clean up this code 2.) make it more idiomatic 3.) be sure that the performance isn't terrible (it's not used in a bottleneck situation, but just to learn) https://github.com/sgrove/riseos/blob/master/dispatch.ml#L80-L115
<ggole>
match !count_remaining with | 0 -> dest_list | n when n < 0 -> dest_list | _ -> ... is a bit strange
<ggole>
Why not if !count_remaining <= 0 then dest list else ...?
<Drup>
(Also, you use sublist with start at 0, it's already implemented as CCList.take, and in this case, the main loop is a CCList.take_while
ontologiae has quit [Ping timeout: 246 seconds]
jeffmo has joined #ocaml
<seangrove>
Drup: Yeah
<seangrove>
Drup: I'll look at OcamlContainers - always a bit nervous about bringing in too many deps since I have esoteric build targets
<Drup>
the core of containers is pure ocaml, so it's fine
Anarchos has joined #ocaml
Algebr``` has joined #ocaml
Haudegen has joined #ocaml
lobo has joined #ocaml
<companion_cube>
orbifx: I'm interested if the bug is in a library of mine
<companion_cube>
(also, you can tab complete nicknames in IRC ;p)
yunxing has quit [Remote host closed the connection]
apluke has quit [Ping timeout: 240 seconds]
orbifx2 has joined #ocaml
octachron has quit [Quit: Leaving]
Algebr`` has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
warp has quit [Ping timeout: 260 seconds]
ggole has quit []
darkf has joined #ocaml
orbifx has quit [Ping timeout: 260 seconds]
seangrove has quit [Ping timeout: 244 seconds]
mort___ has joined #ocaml
mort___ has left #ocaml [#ocaml]
yunxing has joined #ocaml
<j0sh>
how are js_of_ocaml DOM attributes/properties implemented? I see there is a <get:..., set:...> signature (and the corresponding js implementation is straightforward), but how/where are the attribute names being passed to the get/set functions?
<j0sh>
in the class definition, all i see are signatures but no implementations
<Drup>
there is no implementation
<Drup>
it's how the FFI is done
<j0sh>
hmm. it seems like a clever trick somehow, i can't quite piece it together by looking at the definitions
dhil has quit [Ping timeout: 264 seconds]
NingaLeaf123 has joined #ocaml
NingaLeaf has quit [Ping timeout: 276 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Anarchos has joined #ocaml
silver has quit [Read error: Connection reset by peer]
<Drup>
Have you read the manual ?
* Anarchos
never reads manual : irc is my interactive manual !
<companion_cube>
gah, have to implement KMP in direct and reverse mode ;_;
xvw_ has joined #ocaml
BitPuffin has quit [Read error: Connection reset by peer]
silver has joined #ocaml
yunxing has quit [Remote host closed the connection]
Kakadu has joined #ocaml
<flux>
<- wrote super-minimal unsafe mp4 video writing binding for ffmpeg!
* malc_
wrote the same digital aeons ago
<malc_>
not fun
<flux>
I see you either didn't release it in opam.. :)
<flux>
it was that bad though, I've been doing some ffmpeg-related stuff recently so I was able to make that mostly by reading the muxing.c example :)
<malc_>
flux: i had to give up on ffmpeg version though
<malc_>
and use live555 muxing code
<malc_>
for some reason it's output was more digestible by weird consumers (like PS3 and ipad)
<flux>
I have some desire to receive RTSP streams, does live555 do that?
<malc_>
yep
Anarchos has quit [Ping timeout: 268 seconds]
seangrove has joined #ocaml
<flux>
no ocaml bindings though?
tumdum has quit [Ping timeout: 260 seconds]
tumdum has joined #ocaml
tumdum has quit [Changing host]
tumdum has joined #ocaml
<j0sh>
Drup: ah i think i figured it out. the jsoo ppx translates the props into get/set object calls, and those in turn go through the FFI?
<Drup>
Yes
<j0sh>
gotcha
seangrove has quit [Ping timeout: 248 seconds]
<flux>
malc_, do you have an idea if the rtsp protocol is complicated?
<flux>
and if rtp is
yunxing has joined #ocaml
<malc_>
flux: it is.. plus it's choke full of legacy issues
<malc_>
i.e. too support every client/server you have to be very _very_ cautious
xvw_ has quit [Quit: xvw_]
<flux>
I have these chinese ip cams I'd like to receive video data from and it would be great not to -completely- rely on C-written libraries to do that.. :)
<malc_>
flux: in my experience those .cn cameras almost universally run live555 :)
<flux>
so that way I would at least get complete bug-for-bug compatibility ;)
<malc_>
yep :)
<malc_>
that said.. there be dragons
<malc_>
live555 author is very peculiar human being
<malc_>
and his method of distribution and dealing with users is very particular
<malc_>
Ross Finlayson is his name (or something close to that)
<j0sh>
rtsp is not too bad, it's a http-like. where it gets complicated is if you have endpoints with different ideas of what the SDP should be, codec configuration and media stream pecularities, etc...
<flux>
rtsp indeed seems straight-forward, but then rtp and rtcp seem to bring in some complexity..
<malc_>
flux: the operative word is "seems"
<malc_>
yeah thing seem okay and simple
<malc_>
reality throws a giant wrench though
<malc_>
and DEBUGGING this is a pain, esp. on the black boxen
<j0sh>
yeah. if you control both sender and receiver, then it's alright. but dealing with third party clients/servers... blah
<malc_>
spot on
<flux>
well, as long as it's not encrypted wireshark should help quite a lot?-o
<malc_>
nope
<malc_>
too many variables at play
<flux>
in particular as there are working implementations to compare to
<malc_>
the receiver might not like redundant space for crying out loud
<j0sh>
wireshark actually has quite good telephony dissectors for sip/rtp, it even parses out the sdp to infer the correct payload types
AlexRussia has quit [Ping timeout: 260 seconds]
<j0sh>
i haven't done any rtsp in a long time, but i imagine the wireshark support is decent for rtsp flows as well
<malc_>
yes, sure you will see the exchange
Algebr``` has quit [Ping timeout: 248 seconds]
<malc_>
but you would never know WHY one of the sides fails
<malc_>
with lovely errors like ABRA-6732499
<malc_>
pain
<j0sh>
that is not something you can really determine from wireshark anyway though :)
<malc_>
i can not play this stream because saturn is not properly aligned
<malc_>
tuesday??? forget about it
<flux>
so bitter :)
<malc_>
grumpy
<malc_>
not bitter :)
groovy2shoes has joined #ocaml
<flux>
in a client role it's perhaps a bit easier?
<malc_>
yep
<flux>
it seems also that binding to a library with so large surface would be a PIA as well..
<malc_>
PIA = pain in anal cavity?
<flux>
well, plain "ass", but anal cavity is fine :)
<malc_>
sdcv PIA
<malc_>
Found 3 items, similar to PIA.
<malc_>
-->Virtual Entity of Relevant Acronyms
<malc_>
-->pia
<malc_>
<malc_>
PIA
<malc_>
Plug-In Administrator
<malc_>
<malc_>
PIA
<malc_>
Peripheral Interface Adapter
<malc_>
<malc_>
sdcv PITA
<malc_>
Found 4 items, similar to PITA.
<malc_>
-->Virtual Entity of Relevant Acronyms
<malc_>
-->pita
<malc_>
<malc_>
PITA
<malc_>
Pain In The Anatomy / Ass (telecommunication-slang, Usenet, IRC)
<malc_>
slash^ has quit [Read error: Connection reset by peer]
dhil has joined #ocaml
sepp2k has quit [Quit: Leaving.]
Ruff has joined #ocaml
julien_t has quit [Ping timeout: 244 seconds]
<companion_cube>
yeah, now CCString will use KMP
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
<flux>
kmp?
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
<companion_cube>
Knuth-Morris-Pratt
keep_learning has quit [Quit: Leaving]
<TheLemonMan>
is it faster than BMH ?
lokien_ has joined #ocaml
malc_ has joined #ocaml
fantasticsid has joined #ocaml
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
_andre has quit [Quit: leaving]
yunxing has quit [Remote host closed the connection]
johnf has joined #ocaml
infinity0 has quit [Ping timeout: 276 seconds]
<aantron>
i am having increasingly intense urges to just write a new ocamlbuild
<adrien>
oh, do it!
<adrien>
and give up in two days
<malc_>
erm..
<malc_>
take Shake
<malc_>
ocamlify it
<malc_>
profit
<adrien>
but it's useful to try it once so that you know to not try it another time
<orbifx2>
Divide and conquer aantron
<aantron>
im not coming from a learning point of view. but i wont do it, i just need to be talked out of it :p
Anarchos has joined #ocaml
<malc_>
aantron: it must be done actually
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
<aantron>
malc_, why do you say that?
<malc_>
aantron: because i do not particularly enjoy when haskellites make fun of me using haskell based build system
<malc_>
for ocaml thing
<aantron>
hah, so you are using shake to build ocaml?
<malc_>
aantron: to build my stuff that is 2/3 ocaml and 1/3 c
<Anarchos>
malc_ ocamlbuild is able to deal with mixed ocaml/C code
<malc_>
and i'm willing to even forget the horrible copy files around thing
<malc_>
[for an initial implementation]
jeffmo_ has joined #ocaml
<malc_>
Anarchos: okay
jeffmo has quit [Ping timeout: 250 seconds]
jeffmo_ is now known as jeffmo
yunxing has joined #ocaml
seangrove has joined #ocaml
Ruff has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 276 seconds]
seangrove has quit [Ping timeout: 246 seconds]
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
yunxing has quit [Remote host closed the connection]
Kakadu has quit [Ping timeout: 268 seconds]
Kakadu has joined #ocaml
orbifx2 has quit [Ping timeout: 248 seconds]
yunxing has joined #ocaml
<companion_cube>
actually my KMP implementation isn't much faster than the naive algorithm :/
<TheLemonMan>
companion_cube, it's hard to beat strstr
<companion_cube>
but I don't want to link C
<Anarchos>
companion_cube did you look on google "why is grep so fast" ?
<companion_cube>
Anarchos: not really related...
<companion_cube>
this is all in memory, comparing OCaml implementations
<Anarchos>
companion_cube ok.
* Anarchos
is tired to add LC_CTYPE=C to each ocaml command ...
<TheLemonMan>
companion_cube, you might just be hitting the worst case
<edwin>
companion_cube: are you searching for a limited length static string? I've experimented with shift-or / shift-and algos a while ago and they're very fast, even in OCaml
<companion_cube>
are they simple?
<companion_cube>
I'm trying to improve the default search algorithm for CCString, so it has to be general purpose
<edwin>
you encode your state machine into bits
<edwin>
so as long as your pattern is up to 32 or 64-bits in length they work well
<companion_cube>
ah, meh
<edwin>
(and well if its longer you can just do a fast search with shift-or/shift-and and fall back for regular matching once you found a potential prefix match)
<companion_cube>
but is it always fast fr for the first 63 bits?
<companion_cube>
(if you have code, I'd be interested)
<edwin>
most of the speedup comes from processing multiple bytes at once (well I didn't try more than 2 cause that needs a 64k table already), and advancing the FSM by using bit-level masks
<edwin>
I have some C code (will point you to it in a moment), and I did have some OCaml code, but I need to find
<companion_cube>
oh, if it requires lots of memory it might be a problem
<edwin>
it can work with a 256 lookup table too
<companion_cube>
well, good night, but if you have some c ode I'm always interested
<companion_cube>
I saw rust uses "two way string matching", that looks interesting too
<edwin>
the actual algo is simpler, will try to find my ocaml code, I had some pointers to a site describing the basic algo there
<malc_>
the python string searching is quite fast too
orbifx has joined #ocaml
Emmanuel` has quit [Quit: Konversation terminated!]
Emmanuel` has joined #ocaml
<companion_cube>
I wonder whether a rolling checksum would help
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
nicholasf has joined #ocaml
infinity0 has joined #ocaml
blockzombie has joined #ocaml
Haudegen has quit [Ping timeout: 268 seconds]
<tobiasBora>
Hello,
<tobiasBora>
When I run an Ocaml program, sometimes it eats all the memory of my (Linux) system, and I can only hard reboot to recover a working desktop.
<tobiasBora>
Do you have a solution to say "doesn't eat all others apps" ?
jeffmo has quit [Quit: jeffmo]
<orbifx>
companion_cube: rolling checksum for what?
jeffmo has joined #ocaml
<orbifx>
tobiasBora: that is more of an OS functionality
<orbifx>
unless you want to modify the program so that it isn't so gluttonous
Haudegen has joined #ocaml
tane has quit [Quit: Verlassend]
reynir has quit [Read error: Connection reset by peer]
reynir has joined #ocaml
NingaLeaf has joined #ocaml
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
NingaLeaf123 has quit [Ping timeout: 250 seconds]
DanielRichman has quit [Ping timeout: 250 seconds]
DanielRi1hman has joined #ocaml
pyon has quit [Ping timeout: 268 seconds]
demonimin has quit [Ping timeout: 250 seconds]
averell has quit [Ping timeout: 268 seconds]
demonimin has joined #ocaml
demonimin has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
Simn has quit [Quit: Leaving]
malc_ has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 244 seconds]
lobo has quit [Quit: leaving]
hnagamin has joined #ocaml
hnagamin has quit [Client Quit]
silver has quit [Quit: rakede]
HoloIRCUser has joined #ocaml
HoloIRCUser has quit [Remote host closed the connection]
yunxing has quit [Remote host closed the connection]