logs archiveBotHelp.net / Freenode / #ada / 2015 / August / 13 / 1
sparre
Good morning (+time zone corrections)
(Action) notices that Shark8 seems to have forgotten that something may depend on a specific version range of something else.
(Action) doesn't get the point of using an intermediate representation in an Ada package management system.
You would have to compile the IR back to actual Ada to use the sources.
Visaoni
I'm not 100% on that, but I think his idea is that it would ensure it is a valid Ada program
seems like there would be other, simpler, methods
sparre
And generating the IR would only ensure that the IR generating compiler accepted the input.
Yes.
Visaoni
sparre: maybe it's also to automatically deal with some versioning stuff? check what's changed or not kind of thing
sparre
Visaoni: It might. But wouldn't that be very costly (writing a whole compiler front-end) for a very small benefit?
(Action) wonders wher Shark8 is hiding, now that I've found time to criticize his work. ;-)
Visaoni
sparre: I don't know if Shark8 intends to write a compiler front-end, although he would certainly *need* one...
antranigv
finally
I understood
:P
thanks to Shark8
Visaoni
\
charlie5
\o
marino_: had a few ays off ... wil do the gps PR tomorrow or this w/e
days
still wondering what might be best next to tackle packagewise
!quote
Allegra--
There are truths which are not for all men, nor for all times.
-- Voltaire
charlie5
(Action) leaves that one alone
ajdlinux
anyone able to explain this behaviour that a friend of mine is observing with modular types on GNAT? http://pastebin.com/4ctCm3yr
tkoskine
Looks like some optimization / code generation bug. Are you compiling with "-gnato -gnatE" flags, btw?
I can repeat the bug on Debian with gnat 4.6.
sparre
And with gnat 4.9.
(Action) agrees with tkoskine.
ajdlinux
i've tested on 4.9 and 5.2.1 on Debian, and my friend has tested on Windows
trying with flags now
tkoskine
Same result with those flags.
sparre
It looks like something you should report to the GCC team (and probably also AdaCore).
ajdlinux
yeah - both of us are primarily C devs so we're not particularly familiar with the relevant Ada semantics, but we figured it's either a bug, or a massive violation of principle of least surprise in the spec...
also, when compiled with -Wall, we get "Ordering2.adb:9:36: warning: condition is always True"
sparre
Which indicates that it is likely to be a bug in some static analysis component of the compiler.
(i.e. not code generation)
kensan
My guess is that is related to the arithmetic being performed in the base type and mod reduced on final assignment/output.
ajdlinux
that sounds about right
sparre
kensan: But Mod_Type'Base isn't different from Mod_Type.
kensan
sparre: I thought it was universal integer.
sparre
Hmmm...
I'll look it up.
According to the LRM a base subtype is an unconstrained subtype of the type.
As Mod_Type isn't constrained, it is effectively its own base type.
kensan
sparre: Maybe the "for .. in"-construct does not use Mod_Type for the variable I.
sparre: which would be a bug imho.
ajdlinux
I don'if I change everything to I + X
sorry
I don't think so
if I change everything to I + X, where X : Integer := 1, it errors
also doesn't explain why "I < 1 + I" gives the expected result as opposed to "I < I + 1"
sparre
Probably because the static analysis algorithm in the compiler is a bit lazy.
ajdlinux
okay, well consensus semes to be it's a bug of some sort, so i guess we'll go and report it... thanks for the help everyone
jk4_
then in a few years it might be silently fixed
sparre
I suppose we also ought to ask the ARG *why* "<" and ">" is declared for types with wrap-around arithmetic.
I could be tempted to make them aliases for True.
tmyklebu
because ((x-y) & 0x80000000) != 0 is so much less readable.
sparre
tmyklebu: For modular types?
tmyklebu
< and > on modular types are useful.
sparre
What is their meaning?
tmyklebu
< and > on the representative that is between 0 and m-1.
sparre
When do you need them?
tmyklebu
what do you mean by "need"?
sparre
Some use-cases, where they make sense to use.
tmyklebu
when you're reconstructing the result of a computation using the chinese remainder theorem, "< m/1000000" is a fairly good heuristic for checking whether you're done.
there are versions of this that are rigorous, too.
sparre
Okay. I will take your word for that (it isn't a theorem I can remember).
tmyklebu
also, when doing remainder trees. you want to reduce a big number B mod a bunch of little numbers l1, l2, ..., lk. reduce B_{1,k} = B % l1l2...lk, then reduce B_{1,k/2} = B_{1,k} % l1l2...l_{k/2} and B_{k/2+1,k} = B_{1,k} % l_{k/2+1}...l_k. keep doing this until you have reduced stuff mod l_i for each i.
you generally want to do a comparison B_{1,k} > l1l2...lk as a quick-accept so you can avoid doing unnecessary divisions.
< and > on numbers modulo something crop up a fair bit in nontrivial number-theoretic code, actually.
sparre
I can't see why those calculations are in a modular type.
Not exactly my field.
tmyklebu
you use modular bigints so you don't fu*k up other parts of whatever computation you're doing.
sparre
But good to know that it is useful.
tmyklebu
life is too short for integer wraparound bugs in this sh*t.
sparre
Wouldn't you rather use unbounded bigints?
tmyklebu
unbounded bigints can be a performance bug.
(crash-on-overflow bigints and modular bigints both make sense, however, depending on how much patience you have for programming.)
darkestkhan
sparre: < and > are defined in math for modular types so they do have meaning
although I don't use these operators often
Shark8
!last
« prev next »