<ocaml347>
Will read. I wish to write one for Java exception handlers. Where do I start ? Read Hack or Reason code ?
<jwatzman|work>
ocaml347: FB has more than just Hack and Flow (now there's Reason and Infer and other cool stuff), so I can't speak for those teams
<jwatzman|work>
ocaml347: I'm not in that world anymore, I don't know anything about Reason myself, sorry, hopefully someone else in here can answer :)
<ocaml347>
I am asked to audit code visually. After looking at Reason it seems absurd.
<reynir>
ocaml347: reason *is* ocaml, basically
<flux>
ocaml347, what do you mean?
<ocaml347>
I mean that it should be possible for even someone like me to code simple checkers, Right ?
<ocaml347>
I am getting to introduced to OCaml and like it.
<flux>
ocaml347, well, first you need to write a Java parser
<flux>
so I think that's going to be a big part of the task..
<flux>
and then perhaps a Java typechecker.. probably quite big as Java has generics..
<ocaml347>
I know.I use Java/ANTLR.
<ocaml347>
So again. What does OCaml have specially that makes these tasks better?
<flux>
you could perhaps take a look at the ocaml compiler and think how you would express the same things in some other languages.
<ocaml347>
Could you elaborate ?
<flux>
Of Java, C++ and OCaml I would personally choose OCaml for a symbolic manipulation/compiler project :), unless there are some big enough benefits (ie. pre-existing libraries..) for the other languages
<flux>
ocaml347, have you written a parser before?
dmi3y has joined #ocaml
silver has joined #ocaml
<ocaml347>
No. But I change ANTLR's grammar and introduce Java code. This graph in stored in Neo4J. Since it is a graph it is easier to change the code.
<ocaml347>
ANTLR's Java parser grammar.
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ocaml347>
I mean ANTLR is doing everything except the Neo4J code and listeners I write.
<ocaml347>
How can OCaml make this more powerful ?
wu_ng has quit [Ping timeout: 268 seconds]
<flux>
by not needing to use listeners. removing the need to internal object state, rather traversing directly and recursively with the syntax.
<flux>
and warning about unmatched cases
<flux>
allowing writing helper functions that help to remove repetition in the code in the small
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<flux>
ah, forgot about that, that's probably a great starting point
<ocaml347>
yes
<flux>
in particular as it seems to be maintained
<tobiasBora>
Hello,
zirman has joined #ocaml
zirman has quit [Changing host]
zirman has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
malc_ has joined #ocaml
<tobiasBora>
I would like to know if it would be possible to have an updated fedora repository for opam, the last supported fedora version is F22 while we are now at F25.
TarVanimelde has joined #ocaml
infinity0 has quit [Remote host closed the connection]
TarVanim_ has joined #ocaml
infinity0 has joined #ocaml
zirman has quit [Remote host closed the connection]
TarVanimelde has quit [Ping timeout: 250 seconds]
jonasen has joined #ocaml
<def`>
infer is not a trivial project to begin with :P
<flux>
def`, is parsing java and doing (runtime) exception leaking detection then trivial?-)
<def`>
ahh, no no :). but there is a gap between plzoo and infer
<flux>
a gap narrower than going from 0 to infer, though?-)
nore has quit [Ping timeout: 256 seconds]
orbifx-m has joined #ocaml
<orbifx-m>
What are the advantages and disadvantages of using [@unboxed] when passing arguments to foreign interfaces?
<orbifx-m>
Other than the practicalities, i.e. being able to handle interfaces not designed for ocaml
<def`>
overhead
<def`>
boxing has some costs
Jarth has quit [Quit: Jarth]
<orbifx-m>
But most values are boxed anyway right?
Jarth has joined #ocaml
Jarth has quit [Client Quit]
TarVanim_ has quit [Quit: TarVanim_]
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
TarVanimelde has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
nore has joined #ocaml
<def`>
yes, it is useful for specific case.
<def`>
imaging calling a primitive taking a float on each step of a big loop.
<def`>
the float will be computed unboxed by ocaml, will be boxed for calling the primitive and unboxed after.
pierpa has joined #ocaml
wu_ng has joined #ocaml
Onemorenickname has joined #ocaml
<Onemorenickname>
hi people
<Onemorenickname>
i'm trying to compare two floats using ">.", but i get an "unbound value" error
<adrien>
use >
<adrien>
comparisons are polymorphic
<Onemorenickname>
there is polymorphism in ocaml ?
<Onemorenickname>
oh, ">" applies to string too.
<Onemorenickname>
and to all types.
<Onemorenickname>
i see
<Onemorenickname>
hm.
<zozozo>
yeah, ">" is kinda magic
<zozozo>
same as "="
<Onemorenickname>
isn't that a problem ?
<zozozo>
how so ?
<Onemorenickname>
why should ">" be defined on types where it does not make sense ?
<zozozo>
well, ">" is actually written in C and inspects the actual in-memory representation of the values
<Onemorenickname>
oh.
<zozozo>
that's how it is polymoprhic, and the reason why using it for anything other thant base builtin types should be avoided
<Onemorenickname>
it works fine for float ?
<Onemorenickname>
you answered it
<Onemorenickname>
thanks ^^
<ggole__>
It is a bit of a problem in that = and < raise exceptions for "wrong" values, and they might not do what you want for types with semantics that don't match their physical structure
<Onemorenickname>
ggole__, what are "wrong" values ?
<zozozo>
functions and cyclic values
<ggole__>
Functions, C values
<Onemorenickname>
...
<ggole__>
And cyclic stuff, yes
<Onemorenickname>
i suppose if i have a structure with a closue/function in it, then it is a wrong value ?
<ggole__>
Yep
<zozozo>
yup
<Onemorenickname>
there is the problem with = too ?
<zozozo>
you should define your own comparisons functions for the types you define
<Onemorenickname>
for the closure/function
<ggole__>
Yep
<Onemorenickname>
is there an ocaml extension with polymorphic functions ?
<Onemorenickname>
like, intersection types, or whatever
kamog has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
maattdd has joined #ocaml
<ggole__>
There's an experimental branch somewhere with modular implicits which should allow a more principled approach
<zozozo>
well, rather, more powerful polymorphic variants
<ggole__>
A reasonable alternative is to program with minimal or no use of = and <, just using monomorphic functions
<Onemorenickname>
zozozo, i love the first paragraph of the abstract of your paper
<Onemorenickname>
Oh, it's Guiseppe Castagna !
<zozozo>
it's *not* my paper
<Onemorenickname>
zozozo, is there an experimental branch with this ?
<Onemorenickname>
(that is not cduce)
<zozozo>
I have no idea
AlexDenisov has joined #ocaml
<Onemorenickname>
(so many papers to read)
<Onemorenickname>
(life is good)
orbifx-m has quit [Remote host closed the connection]
dmi3y has quit [Quit: dmi3y]
dmi3y has joined #ocaml
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
okuu has joined #ocaml
jonasen has joined #ocaml
ewanas has quit [Ping timeout: 260 seconds]
ewanas has joined #ocaml
TarVanimelde has quit [Quit: Leaving]
shinnya has joined #ocaml
dhil has joined #ocaml
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BitPuffin|osx has joined #ocaml
TarVanimelde has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
agarwal1975 has joined #ocaml
copy` has joined #ocaml
marsam has joined #ocaml
dhil has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexRussia has joined #ocaml
cxre has quit [Quit: Page closed]
AlexRussia has quit [Ping timeout: 240 seconds]
al-damiri has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
AlexRussia has joined #ocaml
nomicflux has joined #ocaml
<ocaml347>
let c = [] in let recursive () = c = [1]; recursive () Is it possible to reinitialize c everytime I make the recursive call ?
<ocaml347>
Start with a fresh list.
agarwal1975 has quit [Quit: agarwal1975]
<ggole__>
That doesn't actually mutate c (which is immutable), but if you want to allocate a new ref each time you call a function, just let f () = let r = ref [] in ...
ggole__ is now known as ggole
eikke has joined #ocaml
maattdd has quit [Quit: WeeChat 1.5]
maattdd has joined #ocaml
zv has quit [Ping timeout: 244 seconds]
sh0t has joined #ocaml
agarwal1975 has joined #ocaml
programo has joined #ocaml
<zozozo>
ocaml347: in what you wrote, "c = [1]" is a boolean expression (evaluating to false since c is immutably equal to the empty list), I'd recommand activating warning 10 (and 5)
malc_ is now known as gcc`
gcc` is now known as malc_
<programo>
Hi This code gives me wrong output, can anybody help me with it?
<octachron>
programo: Note also that using "(x - y) <> 0. " does not work most of the time
<programo>
octachron, So what sign works most of the time?
dhil has joined #ocaml
<octachron>
programo, the problem is not sign, but computational errors and their accumulation
<programo>
= <>equality / inequality (deep)
<octachron>
floating point arithmetic is not exact, so having a value precisely equal to 0 should be treated as an event of zero probability
<programo>
== !=equality / inequality (shallow)
<programo>
okay
<lyxia>
== and != are physical (in)equality
<programo>
When should I use shallow and when should I use deep?
<programo>
lyxia, I did not get what you meant
<programo>
by physical inequality
<octachron>
programo: in simpler term, a better approximation of what you meant is probably "abs_float ( x -. y ) < ε" for you prefered (small) value of ε
<Onemorenickname>
by the way programo, float values also include infinity, if you do 2./0., you will get +infinity
<Onemorenickname>
2./.0. *
<ocaml347>
@ ggole I get your point.
<Onemorenickname>
(and if you do string_of_float (2. /. 0.), you will get "inf")
<thizanne>
programo: you want to use = <> most of the time, that means "the two values are the same"
yegods has joined #ocaml
<thizanne>
== and != roughly means "the two things are located at the same address in memory"
MercurialAlchemi has joined #ocaml
dmi3y has quit [Quit: dmi3y]
Simn has quit [Read error: Connection reset by peer]
<qmm>
wouldn't it be best practice to remove .cmi files since they are intermediate files? why would you keep them around?
noddy has joined #ocaml
ygrek has joined #ocaml
Natalya has joined #ocaml
<Natalya>
Hello! I am from Moscow. Does anyone want to chat?
Natalya has quit [Client Quit]
dhil has joined #ocaml
<ggole>
So you don't have to keep recompiling the same files again and again
<ggole>
.cmti and .cmt aren't necessary for compilation, they are aids for tooling
<qmm>
ggole: thank you!
zaquest has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
zirman has quit [Quit: Leaving...]
FreeBirdLjj has joined #ocaml
AltGr has left #ocaml [#ocaml]
zaquest has joined #ocaml
<aantron>
just enabled all ocaml warnings on lwt. "make 2>&1 | grep Warning | wc -l" shows 654...
malc_ has joined #ocaml
Balod has quit [Remote host closed the connection]
Balod has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
programo has quit [Remote host closed the connection]
<octachron>
aantron: at the same time, some of the warning are quite noisy: 4 (aka using _ in pattern) for instance
<aantron>
yes, i usually disable that globally in my projects. but i think in lwt, i will avoid _ and opt out of that warning on an expression-by-expression basis
FreeBirdLjj has quit [Remote host closed the connection]
<aantron>
where _ just makes too much sense
<octachron>
I wonder if it will be useful to have a curated list of sets of warnings somewhere
jao has quit [Ping timeout: 256 seconds]
jonasen has joined #ocaml
jnavila has joined #ocaml
octachron has quit [Quit: Page closed]
ygrek has quit [Ping timeout: 260 seconds]
<companion_cube>
+a-4-44-48-50-29-58@8
shinnya has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #ocaml
kakadu has quit [Remote host closed the connection]
infinity0 has quit [Ping timeout: 250 seconds]
<flux>
just say no to +a :), at leaat for code intended for others to compile.
<companion_cube>
hu, it's fine
<companion_cube>
it's @a which is bad
<companion_cube>
this is still just warnings
<companion_cube>
(except @8 which is an error on non-exhaustive matches)
infinity0 has joined #ocaml
<aantron>
i prefer something close to what @companion_cube just suggested. and going to make warnings into errors in the build bots probably. but not in regular builds by others
<flux>
well yes, my reaction should have been reserved for handling them as errors :)
jao has joined #ocaml
ygrek has joined #ocaml
AlexDenisov has joined #ocaml
FreeBirdLjj has quit []
FreeBirdLjj has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
maattdd has joined #ocaml
dhil has joined #ocaml
zv has quit [Ping timeout: 252 seconds]
nomicflux has joined #ocaml
ggole has quit [Quit: ggole]
marsam has quit [Read error: Connection reset by peer]
kakadu has joined #ocaml
noddy has quit [Ping timeout: 248 seconds]
octachron has joined #ocaml
tane has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
<octachron>
companion_cube, I am surprised by "-50" (documentation comment warning). Is this warning troublesome in your use cases?
<companion_cube>
it's annoying
jnavila has quit [Ping timeout: 256 seconds]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
marsam has joined #ocaml
marsam has quit [Read error: Connection reset by peer]
fre has quit [Ping timeout: 260 seconds]
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
cheater has quit [Ping timeout: 260 seconds]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
cheater has joined #ocaml
cheater has quit [Read error: Connection reset by peer]
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
cheater has joined #ocaml
maattdd has quit [Ping timeout: 250 seconds]
marsam has joined #ocaml
jnavila has joined #ocaml
marsam has quit [Read error: Connection reset by peer]
zv has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
zpe has joined #ocaml
sh0t has quit [Quit: Leaving]
rand__ has quit [Quit: leaving]
jnavila has quit [Quit: Konversation terminated!]
slash^ has quit [Read error: Connection reset by peer]
yegods has quit []
struk|desk has joined #ocaml
isd has quit [Read error: Connection reset by peer]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Onemorenickname has quit [Read error: Connection reset by peer]
kakadu has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
octachron has quit [Quit: Leaving]
AlexDenisov has quit [Client Quit]
isd has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nomicflux has quit [Quit: nomicflux]
Simn has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
zirman has quit [Remote host closed the connection]