Player is loading...

Embed

Copy embed code

Transcriptions

Note: this content has been automatically generated.
00:00:00
okay so i guess you see the description of the talk um what happened
00:00:06
is that's i joined the us gonna days even on when they first talking
00:00:10
two people in the compiler team and then on mon tuesday wed esprit and other things change because
00:00:18
i look at the community and i couldn't work with people um my name is dennis
00:00:21
was sets i'm a physicist so it's a pretty far from like i would say it
00:00:26
but the bulk of people uh are doing here and it colours what i do once by alike
00:00:31
i love obstruct mass one going to put like a lot of type justice and you know play with its
00:00:35
yeah many libraries in this calico system you know people like to be the pox obstruction then
00:00:40
maybe deliberate libraries before but you don't have much documentation um i would be in that camp but that would as i want
00:00:47
this to be useful so maybe we should it struck something nice original and and to the to the community and make it accessible
00:00:54
so basically i get my money from timit
00:00:56
institute which is the public perception sedition unpaid bison
00:01:01
foundation that gives money for foundation of physics like i'd only to
00:01:05
anything useful and followed by walk on on on type of inspire
00:01:09
um you have have different ways to contact me the best is my email address i'm new to to tell but it seems
00:01:14
my that messages all buttons will if if we ever get
00:01:18
a bit accounts um he is like a lot of things but
00:01:22
you will quickly get the feel of is this like something can use all share or it's
00:01:26
something i just put their you know like uh or or get a profiles of these things
00:01:31
um if maybe if before go with the talk like just to share what always thought that was by um this cup
00:01:38
so i walk in quantum physics and we have something really important you know research could bet inequality is just a just a while but
00:01:45
and doing my feasible eyes all i can organise all things and i want to build a database so that people
00:01:50
can look at the research results you know and and t. k. and um
00:01:56
display them in various ways and there s. you know which program in which i'm going to use for
00:02:01
that um i wanted something that was robust something we study types uh something that could one on the web
00:02:08
um and something that would interface with java because a lot of much non mathematical things play well with java so
00:02:14
then start to use colour and of all the the
00:02:17
three nice every conspire that's encode that basically arithmetic and like
00:02:23
uh they today mats and i started to work on it's what i want to
00:02:26
say that i did not rights by uh i'm just not like the crawl maintain no
00:02:30
an hour that's what it is to work with that i guess you got base i'm the opposite i i just don't know they
00:02:36
walk and all the snow they walk it would take me a mom's so uh still i'm i'm going to push this fall out
00:02:43
um if you think about the title uh the electric you waltz number type
00:02:47
and inspire um what's on on the uh uh it's actually a good question
00:02:52
we haven't think as in math well we'll number function complex number putting only else
00:02:57
the thing maybe in business will walkways time stamps or g. p. s. coordinates time offset
00:03:02
are those numbers all do you manipulate them money is also like it could be like a number
00:03:07
but there's maybe a currency attached to it so um it would question nothing like what's a number
00:03:13
second thing is a type and here we moved to something else um
00:03:19
it's really nice to walk with abstract math i have colleagues were very happy to
00:03:22
prove that something exists even with the control show it to me like justin existed
00:03:27
but when you work on a computer you need to be able to what present what you all what you're doing um
00:03:33
but i think the the most important question is all do you i can numbers on a computer what's
00:03:37
going to be the data type um what what are the operation you can do with the a. p. i.
00:03:42
and if i like writing an a. p. i. is going to steer users to wells doing the right thing or not
00:03:48
think about a lot of people know like if p. because if you use f. p. you
00:03:51
can afford to do the right thing um internal representation that goes with the first one and
00:03:58
you are going to take a while like kale folder interact with the world and people
00:04:02
use j. s. one for example or do you transform number between j. or so and
00:04:07
and and skylights actually not very clear if you want to be to be precise on
00:04:11
the going to speak about that just to say that it's it can be an issue
00:04:15
uh what is brian already spoke that it's a type of a project that did not stop it's i'm not comfortable
00:04:22
with cats so there is an intersection between cats ends
00:04:25
by uh it's basically equality and compare is on all the
00:04:30
then on top of cats raft with uh um there's something called algebra that basically makes that with
00:04:35
a anti uh use the same obstruction phone numbers uh two thousand single after that i don't know much
00:04:42
spires eight years all these for a medium size project uh thirty three thousand and
00:04:46
we've got the um just at putting that was gonna trees going to be fun
00:04:51
and the version number uh is not one point four and that's it that's all big problem
00:04:55
like although get one point or and i can tell you you know like his use it's actually
00:05:00
i can just gonna they say oh i'm going to advertise that every and everybody is using it
00:05:03
and then i realise with going to paul bowles like fifty thousand lines of code to start tree
00:05:08
should i tell you to use it if we don't have a me great
00:05:10
migration story you know i'm very different between being an academic inviting call just fold
00:05:16
this yep it uh and then you forget about it's all running a business uh and it's so i mean i have a
00:05:21
control got so the end of that talk is going to be me asking question what do you want out of this um
00:05:30
so what what as via inside um there's an a. p. i. for numbers
00:05:36
if you walked with the um a skeleton of library you know that you can for example
00:05:41
on any collection you can call datsun and is going to to give you the some of things
00:05:47
but you're not going to call some double some fraud some means there is a mechanism
00:05:51
that whatever is your number inside your your sequence is going to compute the sum of that
00:05:56
spy as this on steroids like it's it's much more precise any
00:05:59
did you much more expensive it's maybe too much we see um
00:06:04
that was with exonerate programming if you use go to the to write a some operation for every type if you scan
00:06:10
lines by uh you just want it once and then it's
00:06:13
available for whatever type as that i'm happy i would label
00:06:18
uh and finally we have data types if you need to walk was function washington numbers
00:06:24
they will give you exact computation on on your computer uh and we
00:06:28
have a bunch of things maybe maybe interval arithmetic is going to be useful
00:06:31
to represent a number that you don't know very precisely and a complex incontinence mark
00:06:36
fancy fancy stuff that's it ah i want the uh only people actually use it
00:06:41
um why don't say what's what's myopic gives you more than than the us not every
00:06:47
i mentioned that you can take in in school i can take any sequence um and this would be like the mechanism to point thirteen
00:06:54
on any sequence you can call some um what they like
00:06:58
y'all an insight into gales of double floating point numbers it's
00:07:02
going to walk why because when you call the method some there was an implicit it's all no delegate for saturday that's
00:07:10
going to come into play and it's going to do the right thing start with zero and add
00:07:14
those numbers one by one to uh the second it at some and it works really well um
00:07:21
but they're like tracing is that you could be could be done better the first things that it's
00:07:27
not very precise um if you say this number is numeric you have to actually extend all the rain
00:07:35
and you you can be more precise than that so as an example if
00:07:38
you walk we spot onions some people direct three d. graphics was quite onions
00:07:42
uh oh complex numbers for some reason you complex numbers maybe
00:07:46
a an electrical systems those numbers down the plane down not
00:07:49
they don't have an ordering on the line so you would have to lie there like in brighton you'd find a class and
00:07:55
just to see that are are not implemented uh which is not very sky like
00:08:01
and then if you think that's i don't know the semantics off like they do with this eighty i and i'd
00:08:05
normal precisely what what it is um the second things it every time you do a sec some it will box
00:08:12
so if you have a now re often a million double floating point numbers you call some on it
00:08:17
maybe the niners doing something clever today but in that say twenty and it was not
00:08:21
doing something covered what is going to do it allocates a million double boxes on the heap
00:08:27
and you know many play them and give you returning something that that's
00:08:31
a box of for the ball and then baum bringing back to primitive type
00:08:35
so you're going to have like crazy a location and if you have like hot spots in your code
00:08:39
with was is that stuff is going to be slow to then maybe you're going to write a why lupin
00:08:44
go back to something you would always with goal which is not maybe what we want and other things like
00:08:50
when you say something is all the other something as a plus operation yeah like only a
00:08:54
series of laws that the should obey for people to build the algorithm on top of it
00:09:00
um but but those types don't specify exactly what all those laws and you have no
00:09:04
way to check them so this is what what spiral brings to the to the table
00:09:09
i'm not going to the plan and i just want to check the time
00:09:14
that's very nice ten minutes it's going direct um i'm going to
00:09:19
do you give it more into those things um speak about numbers
00:09:23
maybe your nobody it maybe not if if we to us question interrupt
00:09:28
there was some slack in the presentation so it's it's more laid back a lot trying to cram
00:09:32
um second thing i'm going to show you that calls bios provide a p. s. phone numbers
00:09:38
no i'm just going to give an overview um and then have a benchmark we're going to see
00:09:43
open on those implementation are across the j. v. m. javascript and it's gonna native
00:09:49
i we wanted to do quality um but i don't understand well the definite story there didn't
00:09:54
want to add a something on top but that's that's the plan is to to to look at
00:10:00
what are numbers
00:10:02
so i know last something uh protect natural numbers and everybody uh no was they are but
00:10:10
i remember being here like in geneva switzerland and in primary school and we learn what numbers where and
00:10:17
they try to teach us about binary and um you know the sumo basis when we like eighty also
00:10:23
was very useful for me to want to computing gots normally you we all went to school and
00:10:27
we we don't about natural number something that we know we know what they are like counting um
00:10:33
and then if you have a weight was all natural numbers you just at the sign in maybe maybe a zero
00:10:38
and you get to basically the sign numbers and that's a a
00:10:40
type that carries it wasn't on a computer just allocate as many
00:10:45
bites you need to encode or the or the the bits that compose your number uh
00:10:50
and design for divorce and a presentation use and time you have your time uh diaries
00:10:57
if you want one faction it's something was going next when you when you
00:11:02
first yeah a mathematics at the university we're looking at functions very easy to take
00:11:08
assign number for the the motel an a natural number figure than i mean it all
00:11:12
or would you do that's in a programming language it just a couple of big into i guess
00:11:18
but then something weird happens when you learn about real numbers wide activity did yeah definition that's actually
00:11:24
pretty cool it's a value of a considers quantity that's basically a a distance on the line
00:11:30
it's very natural but or would you would present a distance along the line on the computer it's not very clear
00:11:36
so that maybe look at all the mathematician course work real numbers and it's crazy
00:11:40
um so they're like six construction i don't or on the some them but the the thing that none of this construction can be
00:11:48
you you can do that efficiently on on the computer uh sometimes even impossible
00:11:53
to compute with that so what do you do you we sort of commissions
00:11:59
so there there are two ways to do it you know it's something like okay this day reflect
00:12:04
takes a a a a a i will remove my badge and then we get rid of that's
00:12:11
maybe maybe not this is the should be better yeah there we go
00:12:20
maybe not if you work uh i would not move so what do we
00:12:25
have yeah i'm uh as we seen before if you compute with national numbers
00:12:32
it's exactly we never get have precision issues but your your very limited you can only do the four basic operation
00:12:38
no way to compute the sinus of something for example um
00:12:42
if you just want to use like roots score would for example um you can
00:12:47
move to something as cool as a big numbers and you have those abortion on top
00:12:51
you can see computer exactly so maybe i don't know if you do you geometry you want to insert a sector
00:12:57
maybe in general problem you want to intersect the sphere was a um
00:13:02
um why don't we just saw face maybe you're going to use other big
00:13:05
numbers annual your show that your computer competition uh correct uh to the and
00:13:09
they want to say that computing was exact numbers it's very hard in general on the
00:13:13
slides i will have a link you can look that actually spoken it's impossible to do that
00:13:17
um present everything you want and and the exact so the other thing that people do they they use approximations
00:13:25
and in the j. v. m. walled we have basically two different types of approximations
00:13:29
um is there you just write an intake uh and then you decide how many digits but
00:13:34
decimal digits go on the right of the canal uh that would be the biggest tunnel all
00:13:40
you say um i have the same thing and intake uh and i move digits to the right of the decimal the all of
00:13:46
the of the point but no it's in a binary representation and it's going to be floating point and it's the usual float and double
00:13:53
there's still a porch that's use more like in mathematics and mathematical uh
00:13:57
the basically you keep the whole expression in memory and when you
00:14:00
need to do computation maybe traverse the tree and ask maybe maybe
00:14:04
fifteen digits was not enough let's do more and and you compute more more digits until you're satisfied that you have a a court answer
00:14:11
i don't know much about that and it's not in in spite so uh we can if
00:14:17
no the things like why does this matter um actually it's it's fun because
00:14:23
if you compete with a lot of numbers into i dunno million or billion additions
00:14:27
in the end maybe your going to present a summary of those numbers like accounting
00:14:31
you're going to present a balance sheets and if you have like a one cent
00:14:35
difference between a little billions accountants dome of that because they see if you have like
00:14:40
as as this morning presidents probably that's something bigger is hidden under the senate will really dig through stuff
00:14:46
so if you can get was money you're not going to use fronts because you
00:14:49
just if you don't know where we stand thousand frauds and i'm off like ten cents
00:14:53
and you some and it should give you you what thousand but actually not a
00:14:57
thousand something there is a a very small difference uh so this will use big decimal
00:15:05
because big this one is is is on the stand so something like zero point one can be actually what doesn't it exactly on the
00:15:11
computer and when you do the same thing you get a three zero which is what you want um okay when i see people doing like
00:15:19
block chain stove bit condoms on in java script and they don't
00:15:22
use the court floating point of like the the correct number type if
00:15:26
ah one other call or long uh they're going to run without
00:15:29
having discrepancies in the in the accounting so that that's that's important stuff
00:15:33
um what i wanted to say because floating point numbers they use
00:15:36
this uh exponent based on to something like zero point twenty five
00:15:41
it's one quarter for example off too so if you do the
00:15:44
same thing with your point twenty five actually that competition is exact
00:15:48
so it really depends what you are going to use big this amount all uh floats
00:15:54
um no what do you got on the j. v. m. scholastic by um are kind
00:15:59
of already said that but i'm going to restate it's um the j. v. m. as
00:16:03
a few primitive types but mostly we're going to use those those fall
00:16:08
in ten only the approximate much one or like sign numbers what they do
00:16:12
with the cuts like the range of what you can express stick pretty big
00:16:17
but depending what you do you may want something that's safer and kind of role uh the because they don't all from nicely
00:16:25
float and double the arm encoded in the binary representation but if you look back at
00:16:31
what happens when you write them using like human decimal notation flowed give you six tonight decimal digits
00:16:36
the exponent wages still pretty pretty mighty and double us a bit more position fifteen sixteen digits
00:16:42
um and the exponent ranges is pretty huge ah so this isn't
00:16:47
input is never going to be a problem but often you're going to be to be made there um
00:16:54
yeah you i'm already can for the more that because it's
00:16:58
very abstract and we we need something to kind of refreshed or
00:17:02
our minds and any to distract too little bits before we go on small abstract stuff so what's this um
00:17:10
i dunno who was out of them on that brought forked out 'cause i was fascinated with that as a key there was like seven and
00:17:16
i would as i can do that right now them i'm thirty six i can use that stuff you know to talk about numbers pretty cool
00:17:22
so what happens here is that i rephrase that thing as fast as i can
00:17:25
assure the f. p. s. so that's kind of a benchmark sacrifice gonna compute that image
00:17:30
uh i'm using sky facts and i did not optimised the rough expects and switch pretty stupid
00:17:35
they're not reason it's not a hotspot i'm not losing much time just putting piece
00:17:39
pushing some on the screen so it's basically limited by the uh of a second computes
00:17:46
what i'm what i can do a push the number one two five and i can
00:17:49
compute you see on the console there was floats sold thirty two bits double sixty four bits
00:17:56
and i have two things we were going to see data what if we use generates
00:17:59
to do we lose performance that's going to be a topic later something to go to floats
00:18:04
and every time i double click i zoom on part of that fact are and we said that fraud have like six to
00:18:10
nine digits which means of the everytime i zoom itself often like
00:18:14
assume ten times so maybe have to after six or seven takes
00:18:17
uh we'll see what happens so right now it it was really good i assume i assume two three four
00:18:26
five
00:18:28
okay it's a six
00:18:33
so no i don't have enough president directory what wasn't if we value of the excel composing that image
00:18:39
and i when i do the iteration that computes the the mother board
00:18:42
set i'm going to have like precision problems but if i switch to double
00:18:49
i get like the collects a picture it's still an approximation but the approximation that's
00:18:54
that's the age doesn't matter any face to more and more and more tree fall phi
00:19:03
six
00:19:05
seven
00:19:07
then
00:19:08
and no i'm at the meat of the boat and was the j. v. am i going to run
00:19:12
in a problem that i don't have any type that's a primitive type that past performance as the ball
00:19:17
i can switch to something that's called double double okay so clever hack
00:19:22
but now all my object because they're one hundred and twenty eight bits they are going to be allocated on the heap
00:19:27
so it's going to be slightly stroll uh as you can see and and i don't still have
00:19:32
something on the screen only going to take fifteen or twenty seconds to compute the the new image
00:19:37
i say if it's not too too small because as you mean random part yeah and then i get my image so you
00:19:43
see that's if useful double performance with the very good if
00:19:48
you switch to more precise types it's going to be much slower
00:19:51
the same story would happen with the decimal orson on numbers you get settled of magnitude
00:19:56
stroll down due to you to proceed on uh the increased position and and memory allocation
00:20:01
uh okay i was moving to this um but i don't know if you have question until them because
00:20:06
i don't that's too abstract to like is it useful or you know like uh actually feature intro to cool um so
00:20:13
we've seen like primitive types no i want to see it says uh could do something about we france
00:20:17
types so they think they can stay in the city ridges says that we're going to be pretty fast
00:20:22
uh this is going to be allocated on the heap but you you can use an arbitrary amount of memory which is
00:20:28
uh what provide didn't think uh an arbitrary range you never going to overthrow it's safe uh in that respect
00:20:34
um would be the same as an auditory ranch and then you need to use like increase its white now to decide on the dome of digits
00:20:43
oh yeah yes yes that's that's court um
00:20:52
i said a bit or ranch but of course we're limited by the memory of the computer and at some stage we haven't
00:20:57
limited by the number of atoms in the universe twinkle that
00:21:00
number so indeed we we're never going to like the mathematical obstructing
00:21:04
we always going to one two in addition to questions to the matter but that's a really good a question uh like remark
00:21:12
same thing with our eyes like we're limited by by uh the location um
00:21:20
what was what i just said that dedicated on that hip so you lose a bit of of speed
00:21:24
there sometime the jade in is cavern can see okay but actually uh i'd i can use the stack 'em
00:21:30
i do not the do like a deep analysis of that uh that sometime it helps
00:21:36
um no what does colour on top of that i was gonna as a
00:21:40
few of parameters on the java primitive types um when you use them in
00:21:45
a general contact second collection the box so they're going to be allocated on
00:21:48
the heap receive sometime a performance problem begin to write to begin to go
00:21:55
and brings begin to get into this kind a iraqi and big this and i think
00:21:59
it's of what um but i i didn't didn't wind tunnels it's it's the same name
00:22:04
no if you move to sky j. s. um i think young to me that they did a lot of work
00:22:09
to bring the same semantics of the j. b. and to stella j. s. um and they got it puts you
00:22:16
it it works is twenty well we are going to see data uh what's the performance profile
00:22:21
uh and they speak about the semantics of of a we we lose really top and then scan native is adding
00:22:27
on the primitive types just the on site indigo longs and so on but
00:22:31
that's to interpret operate we seek out which as the inside into got types
00:22:36
the what the style does stay actually brings the same kind of unsigned integer types but
00:22:41
using any out so it's it has this we'll performance profile that's if you use it's
00:22:46
in in aunt jen record it's as good as a primitive type but as soon
00:22:50
as is generally call you put it in an array or collection it's going to box
00:22:56
i'm inspired gives you a lot of types that okay i mean if you need them you know what
00:23:01
to find them a question about the beacons on um and the quality of those is is we wouldn't buy
00:23:08
took um so he and i said i have a fuel with one says and what i just like touched um
00:23:15
all you can be bitten by floating point arithmetic there is a really great a paper
00:23:20
that that your product sometime you might them like a cool mathematical expression are not equivalent when
00:23:25
you when you compute to sometime we need to we got things around to get what you want
00:23:30
and so when i spit um and uh somebody has
00:23:33
complained about like all floating points a semantics where uh
00:23:37
constructed for the j. v. i'm not sure really interested into the in terms of the
00:23:40
g. d. m. and like the trade off in the design uh that's a great resource
00:23:45
if you want to run like use the library the spell every leaves on the
00:23:50
type of all it's a huge thing if you want to see like wheat walks
00:23:54
i've expected like one two thousand lines of code from that every it's
00:23:59
something can read in an afternoon it would be nice pilots over there
00:24:04
i don't have the slides online yet i'm probably going to treat them later today
00:24:08
just take a picture of the screen if if you need the um and i'm going to move to the second topic
00:24:15
second to because a. p. i. and loss for that i'm not going to have side i'm going to look at the code
00:24:21
um and we are going going directly in the court of of of spy
00:24:26
okay
00:24:30
true to his uh okay how do i watch my stuff i think most yeah x. it's so she uh
00:24:41
have the means player projects and we are going to be into the call
00:24:47
and we have extracted like the interesting stuff from from forms by uh and we have for example back
00:24:55
i 'cause to test for equality so any time you have a matter that's as a generic type
00:25:00
and that meant only struggled to compare things for equality you're going to provide that's an
00:25:04
incentive that's a type that's just one question was familiar with type classes yeah we use cats
00:25:10
so it's kind of have the room um as an approximation can think of a by class as kind of a list of methods
00:25:18
that apply to a particular type it looks pretty much like a java as
00:25:23
something could compare it or something like with the bottom of the name for java
00:25:27
but you you're going to provide a function to your sorting routine of the see
00:25:31
the silvery salt as you pass a parameter uh it's a function that takes too
00:25:36
and to feel tight and returns with out there like all they compare um so
00:25:39
that's exactly the same thing or do you compare x. n. y. offsite a return
00:25:44
true if they i couldn't it's but heck does something on top of just pouring
00:25:49
a dictionary of methods there is this sentence via x. should form an equivalence volition
00:25:56
sequence oration means if x. is equipment why unwise thing when i want to see
00:26:01
that x. is equivalent to the sweet things will will form a chain
00:26:07
and we can move to something more of a complex it's going to be all the
00:26:13
it's it's when you you can compare things i was like less than up with other than
00:26:18
um so this this is going to be axes less like well then why and all if
00:26:23
you all those with the thing you want if you want to sort a sequence for example
00:26:29
and any sorting algorithm that you're going to call will walk only because all the these sound
00:26:35
and all those sound if you have a few little that are a respected so the thing is
00:26:40
number should always compare like x. n. y. u. or is ever ration that one is quite a a a record than the other
00:26:47
the second thing is if you have a chain uh uh if like it was boss
00:26:50
way x. is less a core then why and and the reverse then they actually equal
00:26:55
so now it's going to relates a comparison with like the quality that we've seen before
00:27:01
and the thing is if x. is less than why and and what isn't x.
00:27:04
then uh it basically a transmission transmits the uh the uh that that will asian
00:27:11
uh and you have like the description of of everything here um i would use via
00:27:16
we're going to give you that's a type class so although the older type class for
00:27:22
just types in the sky libraries for example there was something what happens
00:27:26
for into goes um comparison of in vegas so everything is over there
00:27:32
equality would basically use the the standard of us thing um that's solid stuff and jeans
00:27:38
and this component that we don't either minus one zero or plus
00:27:42
ones like to compare to in java um it's implemented of all that
00:27:47
and on the consumer side so that's that's all you
00:27:51
define your structure but no spy as was sorting algorithm so
00:27:57
that's stuff all that is uh than session salts will's office assault
00:28:01
quick salt is as on match salt and that's stable indians by uh
00:28:06
you take uh now we have like a yawning starting in a start and end points you going to say okay
00:28:13
if i want to move things around and compare things in that uh ray first of all i need to do
00:28:16
is i re so that's just tiger every but we have to deal with that uh encoding on the j. v. m.
00:28:22
and uh we need to compare elements and we're going to compare elements here
00:28:31
that ah it's sort of like a and item here as well um but no we use that operator
00:28:38
and something magic is coming it's coming here spy animals that when you use that
00:28:42
operate or any other type class all the ins cop there is an extension method
00:28:48
martin on the the opening keynote spoke about extension at uh the and delegates that's basically that mechanism
00:28:55
uh for that you just need to import all on subjects from us by okay
00:28:59
and you can walk is a usual uh operators without and plus and so on
00:29:04
and the magic we haven't like i was going to use the type that's instead of the definite like
00:29:11
the comparison an intake along all accord the method so that that animal that the generosity in the code
00:29:19
um there is another um to uh to to to to cook
00:29:25
but the thing up so she uh i don't know if it's actually relevant for you use cases
00:29:30
you probably are using libraries that you know we do sorting a binary surgeon race
00:29:36
but once that problem solved you don't need to basically white car that those that at the end of the presentation i'm going to ask you like
00:29:43
are you actually writing caught that's in where you can shift
00:29:47
the number type that's when you use it's like is it something
00:29:52
relevant to you and writings and we caught and at the last possible minute i decided for useful to double b. the signal
00:29:59
that's what's by and about but i don't know what advantages to the to the bigger community that's coming later
00:30:05
the other thing that's very cool is that anytime you write on number
00:30:09
type um so something i did he uh it was for math stuff
00:30:15
implemented exact number that the course academic numbers i uh that basically fortune
00:30:19
but then you can use like 'cause sign in sines of rational numbers
00:30:24
and it's very useful for for for good cheer when matt okay sort of
00:30:28
all these numbers you can do square which was then it's it's pretty cool
00:30:31
um but then it to test that they they walk well uh so i have this continuous integration over there
00:30:36
um i want to test like all the knows that we know
00:30:39
in maths should all phone numbers way like those hundred and something tests
00:30:44
but actually what i've wrote in my own caught is this for these two hundred test they come from that
00:30:49
i'm saying implemented that number types academics check that it's
00:30:53
a field check that's uh it behaves well on the conjugation
00:30:57
a check that it's all the all the check that it gives where like uh the addition in
00:31:02
the all the like translation works well just by those fine lines and it gets that's for free
00:31:08
i think this is where the disc uh like a system is moving a little bit
00:31:10
was cats that anytime you implement something you try not to white thousand of unit test
00:31:16
if you have some structures you can explore them and do something like that uh quickly
00:31:21
so so this is the second advantage of using the the machinery of style that you get that's robustness
00:31:27
um i don't know that any question one super fast like just to say
00:31:33
what i show you there we use like the whole morning uh discuss pretty to look
00:31:36
at all would walks um it is like a burning question i wouldn't want right now
00:31:42
otherwise it on the last slide that um the people of this we accepted that it would that would handle email addresses
00:31:48
on the slide they are the conference so you can talk to them you know we made me emailed them to to
00:31:54
you know the bit more like a also that's action but if there is a
00:31:57
question i got one search right now otherwise we just move to the next exciting topics
00:32:04
um let me check my plan i still have yeah i'm close okay with and uh
00:32:11
it's uh and i'm not going to see what's the president story the the sort performance story
00:32:17
so my moving to the um the nice for tell that we've seen uh before
00:32:22
and we're going to see what's the the project this is public
00:32:27
so what i did i put all the computation related to the one that looks
00:32:30
like that in a shared what was it already and i have three back ends
00:32:35
one for j. s. one for j. v. m. and one for native that basically shows a window and you can drag things around
00:32:40
so i can look at the performance of all these types on
00:32:44
these three platforms because we're going to look at all these computational
00:32:49
so i'm going to share the being being being being
00:32:54
so basically what i have i have um on the boat tried very generic it takes a while
00:33:00
no absorption that tells me all to push pixels to an image and like what spectrum
00:33:04
viewpoints in the fact that uh where where the days on an extra implementation of that thing
00:33:11
i love them especially it's like the way you would white called in in any
00:33:14
prima which you pick the type you using and then you write everything with that
00:33:19
so i'm going to get floats and then we're going to see that's the bodies basically got in pace and finding repeats
00:33:26
so the uh main things that's iteration function uh basically taking a position
00:33:32
in the in the plane and they really do we love all the way
00:33:36
eat there it's that's known the until it escapes that's the story of the model boats that i
00:33:41
check if it escapes that while loop or not and if it escapes then i plot how many
00:33:47
iteration did i need to escape that's uh uh the sets or i just loop and i have a
00:33:53
cut off like this and next iteration it's just it's a really pretty pretty set on the ice magic
00:34:00
but no what i did was to say um my called in it's
00:34:03
awful it's so funny to change the number to get a bit more position
00:34:09
i'm going to do a search and replace input double and maybe that that would be the similar something that's so all of this
00:34:15
is pretty pretty boring and you can introduce bugs so the other
00:34:19
way is to use the generate code and as you can look
00:34:25
it looks pretty similar to adjust did something for optimisation and
00:34:29
uh i'm friendly to compute twice something's better just to i'd
00:34:33
it's way different function that's twice because just a press a
00:34:37
pecan looks exactly the same except this is an right now
00:34:41
um and instead of not having a type on it on my class no i can decide that that's i'm going to
00:34:50
choose that model type when i uh in san should that pass so tight a and and the the current
00:34:55
thing fee then all the means i need twelve that type these implicit in scope to be able to one
00:35:00
that's because those interested are going to give me the multiplication the comparison operator and so that's the the mic
00:35:07
and some we have seen before i'm not going to begin to that's that's if use that annotation course specialists
00:35:16
what happens which colour is that's a you can have generate and kaufman card
00:35:22
when you compile from thing was filled and the ball is going to create just for you especially version that
00:35:27
use primitive times on the java machine so what that what i'm going to do now for the performance story
00:35:34
is to run the um uh the card that we have seen four times one
00:35:40
different implementation once the the but implementation and then the
00:35:44
gen make implementation that uses buyer and float and double
00:35:49
but that day i'm basically choosing that's when intentions in stench is
00:35:52
the thing if i look at the the taste i faxed back and
00:35:59
couple of all that i basically have my a conditional engine hits
00:36:07
nevada so i can switch it's uh it starts with the generate double
00:36:12
but when i press a uh one of the digits yeah i'm just going to switch it off an instance
00:36:17
of float double all degenerate that no takes a full bottle generate that takes about how matter and i make
00:36:24
the decision of which one to use when i when i i create an instance of the class okay so
00:36:29
it's your goals for the performance or of that's so i'm switching to the j. v. m. projects running it's
00:36:39
yeah so right now i'm using float when the call is specialised
00:36:44
ice specialist by hand um or one four point five frames per second
00:36:49
if i switch to double which doubles uh precision you see that the basically the speed is exactly the
00:36:54
same because the c. p. u. is using exactly the same passed to compute was single positional double position
00:37:02
double uses twice the memory swedish of big i raise that made a decision
00:37:06
you're going to make i want to have a cat memory use in half
00:37:10
or if you want things on the g. q. that maybe a a choice that's cheap you will be faster for
00:37:14
single position but if you just want to some j. v. m. the stories more less and you don't use memory
00:37:19
then the stories the same know what's really cool is that is to switch between
00:37:24
generally called that's specialise when you when you call it's all got that too specialised by hand
00:37:33
basically you don't see any difference so spy as all this crazy a magic too
00:37:39
enable you to ride on record as you can write to some function on any i write type
00:37:45
and the performance is going to be the same what i do specialist by hand
00:37:48
or use the special mechanism i think that's a great achievement of of style yeah
00:37:54
i don't want to get like expectation too high because the final switch to javascript
00:38:01
so the same story um same same caught on the uh on the composition decide that the
00:38:08
graphic back and it's it's different of calls and you have the frame per second in the little
00:38:14
side of of their happen things very readable for you on that screen but basically four point five
00:38:20
so what it means to from the market call that one at some speed on the j. v. m. on on
00:38:24
the modern javascript engine is going to be simple fast i think that's a great achievement of the strategy esteem cuts
00:38:32
one thing that actually works less well on on on on sky
00:38:36
j. s. effects which so that's to a specialist caught by hand
00:38:42
okay and i go no to the general double i lose
00:38:48
and i don't think you can read that number when i think the colour of the really front can you see that number yeah
00:38:54
okay so i'm going to tell you what it is if i'm on the
00:38:57
specialist pass four point five frame per seconds i move to jenna global nor
00:39:04
uh all all i think my uh ones in java squeegee
00:39:09
eighty kicked in its one now actually there is no difference
00:39:14
not not so much when it's warm that's pretty cool but no if i do the last thing and i go to native
00:39:23
and i run it's
00:39:25
so i'm i gotta surprised and that's it you should look remove the debug but that's maybe the problem
00:39:36
um
00:39:39
jack so with the default options is give me giving you have the performance of
00:39:46
of the j. v. m. and i see a difference between using jen degenerate class
00:39:52
i read is a performance so this is something in between the c. s. like uh i just got this
00:39:57
gonna native running this week i don't know what the the performance calls a story is going to be for that
00:40:02
um but if we see that's the situation is not working for native maybe we need to
00:40:06
rethink the way we we provide the mechanism to an overly close to finishing that talk um
00:40:14
sam wanted speak about laws that's going to be like uh i did that on
00:40:18
the caught the i'm going to skip um how much time remains like three minutes
00:40:24
and we usually finish on time right so as it is now i have a few question for you first question
00:40:30
was use generate we're going to use sex all by
00:40:33
sex some um all during a numeric uh who is that
00:40:40
okay i um was used to float and double in their code
00:40:45
okay was use begins okay cool was use big guessing now
00:40:52
nice ah i've used other types for numbers and all um can you just tell me
00:41:01
what those number type where like just shout we don't don't think we need all washington conspire
00:41:09
okay and it's kinda like all types in school or is it like the same story or
00:41:14
okay something touching my questions on the screen would like like did you know that wasn't was available feels kinda
00:41:20
of things like that would that be useful for you like i'm i just want to like get a fitting
00:41:26
maybe it's not that important you know like uh and i know i need to know where we take spy alike as as an ecosystem
00:41:33
i'm with you about spiral before coming to the talk okay uh and i
00:41:39
using its with using it in projects i'm with you using it in production
00:41:46
got that's scary okay if we need to talk if we need to talk um
00:41:53
as light that's the the most important message us you have two minutes for that
00:41:58
what i want to say it's spy as a very precise call like the um all i direct operational structure
00:42:03
like the type classes it's beautiful maybe it's too precise
00:42:06
we basically we have things like non competitive additive some groups
00:42:11
i've never seen even abstract mass i've never seen that you so maybe we need to drop its um but
00:42:16
that's basically a t. i. design and and i'm not i'm going to be the only person i mean input there
00:42:22
we have excel normal types like utter boy it's it's crazy caught i i don't understand that
00:42:26
caught the but i i've excess ideas from many angles it never block so that that's really cool
00:42:33
the rest of the caught the uh the quality varies we have our like fifty percent got coverage
00:42:38
that is a nearly a hundred percent fifty persons come uh we we don't have any excuses because
00:42:43
we basically of everything as a type class everything can be checked we
00:42:47
should get this at least two two two seventy five or eighty percent
00:42:51
um the other problems that's spiral became kind of the you know magnet
00:42:55
for everything related to make so a lot of people contribute to the pets
00:43:00
last all pets a feature and no it's very difficult to select with the dance um
00:43:06
can you tell us about like what what what what the design consideration
00:43:10
because we need to port it and we don't know exactly what it does
00:43:13
um so that's a problem now that's caught qualities is over the place
00:43:18
c. span as as whichever performance x. use macros or or all the time
00:43:23
um animal they the the the discussion table on the compiler
00:43:27
team in the set for that each we we're considering droppings personalisation
00:43:32
and that's basically the whole uh spires so it's what do we do that's said look we have
00:43:36
in line we have staging so we are going to change the the the mechanism that's by uh uses
00:43:42
that means maybe that we're not going to pulp fifty thousand lines of code
00:43:46
to a complete new mechanism so we need to decide like what's uh to do
00:43:51
the other problems that's buyers big um like the bus factor when was like one point five uh losses acting a lot with like
00:43:59
managing general stuff but that i don't think he used the
00:44:02
kobe is uh and the dons a lot um and i'm
00:44:07
i basically don't understand some parts that understand the rest and then both of us are active so it's kind of
00:44:13
scary to say like you guys are using that in production and i don't know you know all uh what's going to happen with it
00:44:20
um so it's it's okay just project action committee goes some
00:44:25
on tuesday we have discussed we we use menaced by uh
00:44:29
pretty discussed we i use the books by uh and when i use minutes prior to you know
00:44:33
on ball people this at all it's very nice i want to go through them to do more things
00:44:37
so let's okay maybe we should have something that way more uh accessible for people to to contributes
00:44:44
so the idea white noise this but i just got this idea during the week so
00:44:50
uh i really new inputs uh any feedback on that's we want we don't if
00:44:54
i call features and for each of the speech or other t. m. a. migration story
00:44:59
we put the project so for long time there was this as kind as
00:45:03
the project was a lot of single corporate halls and commence cultural that was
00:45:07
maybe not maybe maybe not big enough friendly
00:45:10
and cats started like having good documentation um
00:45:14
trying to humble begin else um i think we can do the same
00:45:18
for spy alike we put the project and provide a a better contributor experience
00:45:23
and i would say we only add features to that's reboot when there was community traction
00:45:29
not because it's nice to have some abstract mathematical type but because
00:45:32
people will be using it in and uh all three in production
00:45:36
the thing i want to say that's a people and discuss preset they're okay to
00:45:40
share the uh uh communication details so i put like the name of people who
00:45:44
looks like all day and starts by in the house so they will be able to we'll look at the code
00:45:49
with you and tell you a few things and i'm here doing until friday friday afternoon to interpret you as well
00:45:57
i think that's the end of my talk that's the end of my time um if i
00:46:02
like to think you but we should still get some time for like your feedback in your question
00:46:08
you can go and uh oh like the talk is finished but i really liked that people were interested in
00:46:13
that story to say and and you know like tell me what you like about it or where you should
00:46:18
when you want to to seize going so thank you
00:46:27
uh so my since one i don't know it
00:46:29
walks if i had if i had fields inspire um
00:46:38
i think we have a like a it's assisting the tests like there is a there's
00:46:42
a there's a class but know that we have singleton titans colour to point thirteen we should
00:46:47
like put the um we have a much better sorry for finite fields and that's
00:46:52
that's a possibility and then now i think they increase yet like complex types like pulled
00:46:57
intervals and they're complex numbers for example and in principle you can compose
00:47:03
complex number of two rational numbers or too big decimals or two loads
00:47:07
or whatever yeah you know that yes absolutely and and more of a
00:47:11
issue dual complex number of into goes it's something called caution in vegas
00:47:15
you you don't get the division but if you do complex noble float you get the division so they
00:47:20
are those they're efficient mechanism that's it gives you as much for cho as your stella type uh gets
00:47:28
there's no want to see the visualisation of performance and uh
00:47:33
uh_huh uh_huh in such a good visualisation tools to use it and the question maybe ask what you could do is
00:47:42
quite different i think there is core in the markets
00:47:45
in it in some way i use a production it will
00:47:50
okay it's more because of those ages is also to build will be is it more of a
00:47:58
is this a p. p. some cool mathematics of the good separation
00:48:04
of those doing what is we or what could be more your
00:48:10
is it says it's okay it's okay uh oh i love that we
00:48:14
stay in touch like everybody was a business case for computing these numbers
00:48:18
i'd love to hear your story in of that's as like a basis for the next
00:48:21
eight p. i. so please accent an email or they're consistent with a like no and then
00:48:26
i collect those and names and we see work or we build the community of like
00:48:30
you know kind of a 'cause what fall for what we do next thanks for your input
00:48:36
and yeah stick one so
00:48:42
it's like a habit to questions remark fast yeah yeah i've just i mean you
00:48:48
focus on the performance quite a lot and i notice that you like using the syntax
00:48:54
does it affect performance because of the extra locations because you like kind of you know to quit about class and like
00:49:00
oh in the performance huh oh good remark so normally when you have
00:49:05
those andreas monitors you can you can have any van or things like that
00:49:09
and then you're going to call a type class yet of the type class so
00:49:13
there are a few levels and the ocean spiral uses michael to remove extra layers
00:49:19
but you're still going to have an interaction that's instead of for example comparing froze directly
00:49:24
you call a matter that compels floats what we've seen on the performance of
00:49:28
visualisation is that the j. v. m. is clever enough to in line that's
00:49:32
but some maybe the native but one doesn't know at one time like
00:49:35
where this come from an is not able to do that in nineteen
00:49:39
uh_huh so that's that's the story and i didn't choose quality um um but i'd love to
00:49:44
see what it does 'cause maybe doesn't have enough information at compile time to do this in lining
00:49:49
uh maybe we can provide that audience uh i've no idea that's uh that's kind of
00:49:55
a space that opens now like until recently won at the j. v. m. but no we
00:49:58
have like other platforms and but on the j. v. m. we do the right thing like
00:50:02
white no we did the right to be there for us yeah it i think i yeah

Share this talk: 


Conference Program

Welcome!
June 11, 2019 · 5:03 p.m.
1574 views
A Tour of Scala 3
Martin Odersky, Professor EPFL, Co-founder Lightbend
June 11, 2019 · 5:15 p.m.
8333 views
A story of unification: from Apache Spark to MLflow
Reynold Xin, Databricks
June 12, 2019 · 9:15 a.m.
1267 views
In Types We Trust
Bill Venners, Artima, Inc
June 12, 2019 · 10:15 a.m.
1569 views
Creating Native iOS and Android Apps in Scala without tears
Zahari Dichev, Bullet.io
June 12, 2019 · 10:16 a.m.
2231 views
Techniques for Teaching Scala
Noel Welsh, Inner Product and Underscore
June 12, 2019 · 10:17 a.m.
1293 views
Future-proofing Scala: the TASTY intermediate representation
Guillaume Martres, student at EPFL
June 12, 2019 · 10:18 a.m.
1156 views
Metals: rich code editing for Scala in VS Code, Vim, Emacs and beyond
Ólafur Páll Geirsson, Scala Center
June 12, 2019 · 11:15 a.m.
4695 views
Akka Streams to the Extreme
Heiko Seeberger, independent consultant
June 12, 2019 · 11:16 a.m.
1552 views
Scala First: Lessons from 3 student generations
Bjorn Regnell, Lund Univ., Sweden.
June 12, 2019 · 11:17 a.m.
577 views
Cellular Automata: How to become an artist with a few lines
Maciej Gorywoda, Wire, Berlin
June 12, 2019 · 11:18 a.m.
386 views
Why Netflix ❤'s Scala for Machine Learning
Jeremy Smith & Aish, Netflix
June 12, 2019 · 12:15 p.m.
5025 views
Massively Parallel Distributed Scala Compilation... And You!
Stu Hood, Twitter
June 12, 2019 · 12:16 p.m.
958 views
Polymorphism in Scala
Petra Bierleutgeb
June 12, 2019 · 12:17 p.m.
1113 views
sbt core concepts
Eugene Yokota, Scala Team at Lightbend
June 12, 2019 · 12:18 p.m.
1655 views
Double your performance: Scala's missing optimizing compiler
Li Haoyi, author Ammonite, Mill, FastParse, uPickle, and many more.
June 12, 2019 · 2:30 p.m.
837 views
Making Our Future Better
Viktor Klang, Lightbend
June 12, 2019 · 2:31 p.m.
1682 views
Testing in the postapocalyptic future
Daniel Westheide, INNOQ
June 12, 2019 · 2:32 p.m.
498 views
Context Buddy: the tool that knows your code better than you
Krzysztof Romanowski, sphere.it conference
June 12, 2019 · 2:33 p.m.
393 views
The Shape(less) of Type Class Derivation in Scala 3
Miles Sabin, Underscore Consulting
June 12, 2019 · 3:30 p.m.
2321 views
Refactor all the things!
Daniela Sfregola, organizer of the London Scala User Group meetup
June 12, 2019 · 3:31 p.m.
514 views
Integrating Developer Experiences - Build Server Protocol
Justin Kaeser, IntelliJ Scala
June 12, 2019 · 3:32 p.m.
551 views
Managing an Akka Cluster on Kubernetes
Markus Jura, MOIA
June 12, 2019 · 3:33 p.m.
735 views
Serverless Scala - Functions as SuperDuperMicroServices
Josh Suereth, Donna Malayeri & James Ward, Author of Scala In Depth; Google ; Google
June 12, 2019 · 4:45 p.m.
936 views
How are we going to migrate to Scala 3.0, aka Dotty?
Lukas Rytz, Lightbend
June 12, 2019 · 4:46 p.m.
709 views
Concurrent programming in 2019: Akka, Monix or ZIO?
Adam Warski, co-founders of SoftwareMill
June 12, 2019 · 4:47 p.m.
1974 views
ScalaJS and Typescript: an unlikely romance
Jeremy Hughes, Lightbend
June 12, 2019 · 4:48 p.m.
1376 views
Pure Functional Database Programming‚ without JDBC
Rob Norris
June 12, 2019 · 5:45 p.m.
6373 views
Why you need to be reviewing open source code
Gris Cuevas Zambrano & Holden Karau, Google Cloud;
June 12, 2019 · 5:46 p.m.
484 views
Develop seamless web services with Mu
Oli Makhasoeva, 47 Degrees
June 12, 2019 · 5:47 p.m.
785 views
Implementing the Scala 2.13 collections
Stefan Zeiger, Lightbend
June 12, 2019 · 5:48 p.m.
810 views
Introduction to day 2
June 13, 2019 · 9:10 a.m.
250 views
Sustaining open source digital infrastructure
Bogdan Vasilescu, Assistant Professor at Carnegie Mellon University's School of Computer Science, USA
June 13, 2019 · 9:16 a.m.
374 views
Building a Better Scala Community
Kelley Robinson, Developer Evangelist at Twilio
June 13, 2019 · 10:15 a.m.
245 views
Run Scala Faster with GraalVM on any Platform
Vojin Jovanovic, Oracle
June 13, 2019 · 10:16 a.m.
1339 views
ScalaClean - full program static analysis at scale
Rory Graves
June 13, 2019 · 10:17 a.m.
463 views
Flare & Lantern: Accelerators for Spark and Deep Learning
Tiark Rompf, Assistant Professor at Purdue University
June 13, 2019 · 10:18 a.m.
380 views
Metaprogramming in Dotty
Nicolas Stucki, Ph.D. student at LAMP
June 13, 2019 · 11:15 a.m.
1250 views
Fast, Simple Concurrency with Scala Native
Richard Whaling, data engineer based in Chicago
June 13, 2019 · 11:16 a.m.
624 views
Pick your number type with Spire
Denis Rosset, postdoctoral researcher at Perimeter Institute
June 13, 2019 · 11:17 a.m.
245 views
Scala.js and WebAssembly, a tale of the dangers of the sea
Sébastien Doeraene, Executive director of the Scala Center
June 13, 2019 · 11:18 a.m.
661 views
Performance tuning Twitter services with Graal and ML
Chris Thalinger, Twitter
June 13, 2019 · 12:15 p.m.
2003 views
Supporting the Scala Ecosystem: Stories from the Line
Justin Pihony, Lightbend
June 13, 2019 · 12:16 p.m.
163 views
Compiling to preserve our privacy
Manohar Jonnalagedda and Jakob Odersky, Inpher
June 13, 2019 · 12:17 p.m.
301 views
Building Scala with Bazel
Natan Silnitsky, wix.com
June 13, 2019 · 12:18 p.m.
565 views
244 views
Asynchronous streams in direct style with and without macros
Philipp Haller, KTH Royal Institute of Technology in Stockholm
June 13, 2019 · 3:45 p.m.
303 views
Interactive Computing with Jupyter and Almond
Sören Brunk, USU Software AG
June 13, 2019 · 3:46 p.m.
681 views
Scala best practices I wish someone'd told me about
Nicolas Rinaudo, CTO of Besedo
June 13, 2019 · 3:47 p.m.
2699 views
High performance Privacy By Design using Matryoshka & Spark
Wiem Zine El Abidine and Olivier Girardot, Scala Backend Developer at MOIA / co-founder of Lateral Thoughts
June 13, 2019 · 3:48 p.m.
753 views
Immutable Sequential Maps – Keeping order while hashed
Odd Möller
June 13, 2019 · 4:45 p.m.
276 views
All the fancy things flexible dependency management can do
Alexandre Archambault, engineer at the Scala Center
June 13, 2019 · 4:46 p.m.
389 views
ScalaWebTest - integration testing made easy
Dani Rey, Unic AG
June 13, 2019 · 4:47 p.m.
468 views
Mellite: An Integrated Development Environment for Sound
Hanns Holger Rutz, Institute of Electronic Music and Acoustics (IEM), Graz
June 13, 2019 · 4:48 p.m.
213 views
Closing panel
Panel
June 13, 2019 · 5:54 p.m.
400 views