waleee-cl has quit [Quit: Connection closed for inactivity]
narimiran has joined #ocaml
Haudegen has joined #ocaml
gahr has quit [Quit: leaving]
gahr has joined #ocaml
narimiran has quit [Read error: Connection reset by peer]
vicfred has quit [Quit: Leaving]
narimiran_ has joined #ocaml
narimiran_ is now known as narimiran
chripell has joined #ocaml
<Leonidas>
at least the async binaries get pretty large for the record…
olle_ has joined #ocaml
p4bl01 is now known as p4bl0
HyperTables has quit [Ping timeout: 245 seconds]
nullcone has quit [Quit: Connection closed for inactivity]
<flux1>
I guess there's no tool for renaming a particular symbol globally in an OCaml project?
<flux1>
It seems like it should be possible to do with merlin, given it's able to find the definition for a given symbol. Just iterate all references in all files and rename the ones referencing the original symbol. One problem would be that it might introduce an error (due to shadowing due to ie. an `open`), but those should be easy enough to fix typically.
<octachron>
rotor?
<olle_>
sed
<flux1>
hmm, I saw a old reference to it but apparently the project is almost dead, "The following dependencies couldn't be met: - rotor -> ocaml < 4.09.0"
<flux1>
sed can do too many false renamings
<flux1>
I think my current approach is going to be: change symbol, iterate compiler errors. maybe I can do an emacs macro to fix them 🤔
mfp has joined #ocaml
<octachron>
Almost dead seems a hyperbole, but yes depending on the compiler internal makes this kind of project maintenance heavy.
rockethead has joined #ocaml
rockethead has quit [Quit: Leaving]
rockethead has joined #ocaml
<flux1>
well, 4.09.0 was released on September
Haudegen has quit [Quit: Bin weg.]
inkbottle has quit [Ping timeout: 244 seconds]
zebrag has joined #ocaml
rockethead has quit [Remote host closed the connection]
rockethead has joined #ocaml
Anarchos has joined #ocaml
Haudegen has joined #ocaml
<Anarchos>
Is there a mean to plug dune as contiinuous integration on github for ocaml projects ?
<Anarchos>
vsiles oh i intend too to implement tiger :)
<vsiles>
Anarchos: :D
<vsiles>
I stopped a bit early
<Anarchos>
vsiles why ?
<vsiles>
I did that in between jobs
<vsiles>
and I do this kind of things for a living now so... no need to continue :D
<Anarchos>
ok
<Anarchos>
vsiles you lucky
<Anarchos>
i just found silly jobs in "IT" aka web and java :/
<flux1>
Anarchos: not even kotlin? cruel and unusual :/
<Anarchos>
flux1 what means 'kotlin' ? Remember i am french
<flux1>
Kotlin is a Java-like programming language with some functional and static typing tricks added.
<flux1>
not all-in like Scala, but rather very Java-like but with more type inference etc
<flux1>
it's a nice thing in particular Android development, but I believe native Java development with that is also a thing.
<Anarchos>
flux1 i tried to explain why lambdas are totally fucked-up in java to my colleagues. I resigned....
ggole has joined #ocaml
dborisog has quit [Ping timeout: 264 seconds]
<Leonidas>
from the job? That sounds kinda extreme ;)
Anarchos has quit [Ping timeout: 264 seconds]
<companion_cube>
so I'm thinking of using objects and *gasp* classes in a project… :-°
dckc has quit [Ping timeout: 272 seconds]
dckc has joined #ocaml
<zozozo>
:O
<companion_cube>
zozozo: you should be concerned
<theblatte>
companion_cube: what about some ppx to go with that?
<zozozo>
companion_cube: is it for benchpress ?
<companion_cube>
theblatte: well tried
<companion_cube>
zozozo: yep
<companion_cube>
just *thinking* about it
<companion_cube>
but long-running functions kind of lack… introspectability
<companion_cube>
interruptibility
<companion_cube>
etc.
noze has joined #ocaml
<noze>
what's a simple situation beyond Hindley-Milner where not all terms have most general / principal types?
<Drup>
in ocaml or in general ?
<noze>
yes
<noze>
(either)
<noze>
if you can give me both, even better :o)
<Drup>
well, a classical examples is polymorphic recursion
<Drup>
(crafting a good example where it's really obvious is not that easy)
<companion_cube>
for polymorphic recursion?
<companion_cube>
papers from Okasaki have exactly that
<companion_cube>
it's not too far fetched :)
<Drup>
companion_cube: crafting an example where a function clearly has two, different, interesting valid types
<Drup>
(and neither are a supertype of each other, and there is no more general type)
<companion_cube>
ah sorry. I see.
<Drup>
in system F, it's a bit easier: `let app_and_sum g x y = g x + g y` can have two types:
<Drup>
`(∀'a . 'a -> 'int) -> 'b -> 'c -> int`. This is another, comparable system F type. In OCaml, you need to use explicit universal quantification with records
<Drup>
`∀'a. ('a -> int) -> 'a -> 'a -> int`. This is the ML type, infered by HM systems
<Drup>
You need the explicit ∀ quantification in the type to properly see the difference
<Drup>
Crafting examples in OCaml is quite hard, because the language is designed so that you will usually have to write different programs for such cases, even when you use features for which inference is not principal
<Drup>
The two main features in OCaml for which you loose principal inference are polymorphic recursion and GADTs
cantstanya has quit [Remote host closed the connection]
<companion_cube>
and weird objects :D
cantstanya has joined #ocaml
<olle_>
lose? or loose?
<companion_cube>
lose
<noze>
sweet, thanks for the reminder Drup.
<noze>
polymorphic recursion is not a feature that is used all the time, but definitely something that comes up naturally
<companion_cube>
it comes very fast if you use GADTs!
<Leonidas>
recursion comes to you fast
<Leonidas>
like the meme
raver has quit [Read error: Connection reset by peer]
<Drup>
Even without GADTs, with the datatypes or arbirarely nested lists like `type 'a t = List of 'a list | Nested of 'a t t`
<companion_cube>
actually useful cases can, again, be found in Okasaki :p
<Drup>
Indeed
<octachron>
Recently, I hit more often polymorphic recursion when refactoring mutually recursive functions ... but that might be a problem specific to the OCaml AST.
Anarchos has joined #ocaml
<Anarchos>
i am back
dborisog has joined #ocaml
raver has joined #ocaml
jnavila has joined #ocaml
benschza has joined #ocaml
jnavila has quit [Read error: Connection reset by peer]
waleee-cl has joined #ocaml
nullcone has joined #ocaml
tane has joined #ocaml
rockethead has joined #ocaml
<Anarchos>
vsiles which parser generator did you use for tiger ? ocamlyacc, menhir, dypgen ?
<Anarchos>
but he began to dig through the exercices
<companion_cube>
ah
<companion_cube>
well the only reasonable solution is menhir
<companion_cube>
so I hope he's using it :p
Haudegen has quit [Quit: Bin weg.]
<theblatte>
companion_cube: re: introspecting long-running functions: you might be interested by this work on "probes": tracing/debug functions you can enable at runtime -> https://github.com/gretay-js/probes. works by rewriting the assembly on the fly!
<Anarchos>
nahhh dypgen is reasonable too :p
<companion_cube>
theblatte: no thanks
<companion_cube>
why do you want me to have a heart attack?
<companion_cube>
Anarchos: for a language parser? nope :D
<companion_cube>
you want something predictible and fast :p
FreeBirdLjj has quit [Remote host closed the connection]
<theblatte>
companion_cube: you're considering using objects, I'm concerned for your blood pressure already
FreeBirdLjj has joined #ocaml
<companion_cube>
nah, objects are boring technology™
<Anarchos>
companion_cube you think dypgen is not fast enough ?
<companion_cube>
idk, it's designed to handle arbitrary ambiguities, that sounds like a very bad property for a formal language
<companion_cube>
menhir is hard to beat there
<Anarchos>
companion_cube yes i understand
<Anarchos>
so let's go for menhir
FreeBirdLjj has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
olle_ has quit [Ping timeout: 260 seconds]
Anarchos has joined #ocaml
<vsiles>
Anarchos: mehirr
<Anarchos>
vsiles ok
<vsiles>
menhir*
<vsiles>
which is the only sane answer :D
<companion_cube>
😌
<Anarchos>
is there a plot against ocamlyacc and dypgen ?
<companion_cube>
ocamlyacc is just menhir, but older and less featureful
<companion_cube>
dypgen is… I don;t see the point of it compared to menhir here :D
<Anarchos>
:)
rockethead has quit [Remote host closed the connection]
vicfred has joined #ocaml
Haudegen has joined #ocaml
remexre has joined #ocaml
rowbee is now known as robi
dborisog has quit [Ping timeout: 240 seconds]
malc_ has joined #ocaml
kini has quit [Remote host closed the connection]
<zozozo>
plus, menhir has the best feature of all : the coq output !
<Anarchos>
coq output ?
<zozozo>
I think menhir has a coq backend where it produces a parser that can be used in Coq
<zozozo>
and that is sued by compcert if I remember correctly
<zozozo>
*used
kini has joined #ocaml
kini has quit [Excess Flood]
kini has joined #ocaml
<Anarchos>
zozozo oh compcert, i forgot this compiler !
<zozozo>
I wonder if there's any interest in distributing a fixpointed compcert/ocaml compiler (i.e. in which the ocaml compiler has been compiled using compcert for the C code, and compcert using the ocaml compiler copiled with compcert)
<Anarchos>
zozozo no idea !
* malc_
thinks that given the way ocaml is bootstrapped there will alawys be a chance to be hit by Ken Thompson hack... compcert or not...
<zozozo>
sure... but then like everything, security depends on your attack modelisation
<zozozo>
i.e. against who and which kinds of attack do you want to be safe
<Anarchos>
zozozo you don't know the Thompson hack ?
<zozozo>
yes I know, but I doubt it's a realistic scenario that your neighbour inserted the hack some years ago in the C compiler, knowing it would then be able to get your password now
<companion_cube>
I don't remember the details on how it's supposed to be so general though
<companion_cube>
for OCaml, what would it look like
<companion_cube>
?
<zozozo>
well, I guess it depends on the scenari imagine in the initial injeciton + the ability to be auto-updated
<zozozo>
but any real use of it would require a trememdous amount of work to correctly insert itself as needed, and insert backdoors into generated programs that can be used
<Anarchos>
companion_cube there is no getpasswd primitive ?
<zozozo>
theoretically, I'd guess the most realistic thing would be for it to insert a backdoor that can connect to an internet service an receive updates, else the static part of it would likely not be general enough Id' think
<companion_cube>
right, in real world it's be super hard to sneak in?
<companion_cube>
(even in a ocmpiler PR that re-boostraps?)
<zozozo>
companion_cube: well relaistically, I'd think it would have had to be introduced some time ago (probably in a C compiler of linker/assembler to be widespread enough to be able to cover its own traces)
<zozozo>
*or
<companion_cube>
i mean, in ocaml
<companion_cube>
does it have to be in the C part?
<zozozo>
no, but it has to be in a potential disassembler it it has any hopes to prevent you from seing it in a disasembled analysis, or a debugger at one point, etc...
<zozozo>
so it has to be in pretty much everything in order to not be seen
<companion_cube>
ah ok
<zozozo>
if one such virus was indeed everywhere, I think it'd be the largest and biggest achievement of computer sciene for the sheer complexity of handling every situation correctly and not being detected
<companion_cube>
heh, sure :D
<companion_cube>
AI complete
<zozozo>
and then, you'd have to be able to do something with it, :p
noze has quit [Remote host closed the connection]
Anarchos has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
mbuf has quit [Quit: Leaving]
Anarchos has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
Anarchos has quit [Client Quit]
Hrundi_V_Bakshi has joined #ocaml
olle__ has joined #ocaml
<olle__>
me
<companion_cube>
you
<olle__>
^^
Hrundi_V_Bakshi has quit [Quit: No Ping reply in 180 seconds.]
Hrundi_V_Bakshi has joined #ocaml
olle__ has quit [Remote host closed the connection]
ggole has quit [Quit: Leaving]
Anarchos has joined #ocaml
narimiran has quit [Ping timeout: 260 seconds]
nullcone has quit [Quit: Connection closed for inactivity]
Serpent7776 has quit [Quit: leaving]
nullcone has joined #ocaml
tane has quit [Quit: Leaving]
ansiwen has quit [Ping timeout: 260 seconds]
notnotdan has quit [Ping timeout: 256 seconds]
notnotdan has joined #ocaml
ansiwen has joined #ocaml
sleepydog has joined #ocaml
<sleepydog>
i'm writing a parser for a binary protocol with Angstrom and i'm not sure how to handled length-prefixed fields that have data i want to parse. how can i make sure my parser doesn't exceed N bytes?
<sleepydog>
i was thinking i could use take_bigstring to get N bytes and call parse_bigstring on it. is there a better way?