eclipse tooling for julia - eclipsecon france2018 tooling for julia tobias verbeke ... 4 people at...

42
Eclipse Tooling for Julia Tobias Verbeke (Open Analytics NV) March 8, 2016

Upload: buithuy

Post on 21-Apr-2018

215 views

Category:

Documents


2 download

TRANSCRIPT

EclipseToolingforJuliaTobiasVerbeke(OpenAnalyticsNV)

March8,2016

OpenAnalytics

DataScienceCompany

3/42

DataScienceCompany

4/42

Julia

WeareGreedy

Wearegreedy:wewantmore.

Wewantalanguagethat'sopensource,withaliberallicense.WewantthespeedofCwiththedynamismofRuby.Wewantalanguagethat'shomoiconic,withtruemacroslikeLisp,butwithobvious,familiarmathematicalnotationlikeMatlab.WewantsomethingasusableforgeneralprogrammingasPython,aseasyforstatisticsasR,asnaturalforstringprocessingasPerl,aspowerfulforlinearalgebraasMatlab,asgoodatgluingprogramstogetherastheshell.Somethingthatisdirtsimpletolearn,yetkeepsthemostserioushackershappy.Wewantitinteractiveandwewantitcompiled.

http://julialang.org/blog/2012/02/why-we-created-julia

6/42

Background

4peopleatMITstartedworkingonsuchalanguagein2009

JeffBezanson,StefanKarpinski,ViralShah,AlanEdelman(AppliedMath)

in2012theyopensourcedtheirefforts

·

·

·

7/42

LLVM

moderncompilerinfrastructurewhichallowsforJITcompilationfordynamiclanguages

nomoretwo-languagesparadigm(Python/C,R/C++),butasinglelanguage

workflow:writesomethingthatworks,applyafewtricks

·

·

·

8/42

Can'tRdothesame?

Computerscientist'sanswer*:

TheTheoryofFexprsisTrivial(1998,MitchellWand).

*PascalCostanza(Intel)

Rhasmanyreflectivefeaturesandthereforeisadeadendforthistypeofcompileroptimizations

Juliaisalanguagedesignedbycomputerscientists,butcomputerscientistswhoknowaboutfloatingpointarithmetic

·

·

9/42

PeakInside

10/42

PeakInside(contd.)

11/42

PeakInside(contd.)

femtolisp:parserwritteninaveryefficientSchemedialect

C/c++core:dealswithLLVMback-endwork

dependenciesonthetraditionalscientificcomputinglibraries(LAPACKandOpenBLASforlinearalgebraoperationsetc.)

alltherest:pureJulia

·

·

·

·

12/42

FeeloftheLanguage

DataStructuresorTypes

julia>subtypes(Real)4-elementArray{Any,1}:AbstractFloatIntegerIrrational{sym}Rational{T<:Integer}

julia>subtypes(AbstractFloat)4-elementArray{Any,1}:BigFloatFloat16Float32Float64

14/42

TemplatedMethodsandDataTypes

Statisticianslikesumsofsquares

Inlinefunctionexample

functionsumsq{T<:Number}(V::Vector{T})s=zero(T);forvinV;s+=v*v;endsend

mean(A::AbstractArray)=sum(A)/length(A)

15/42

DefineCustomTypes

typeDSLname::ASCIIStringlicense::ASCIIStringend

one=DSL("Julia","MIT")

julia>one.license"MIT"

16/42

MultipleDispatch

OOparadigm:object.method(arg1,arg2)

multipledispatch:method(object,arg1,arg2)

similartoClosure,S4methodsinR

genericmethodsandfunctions

·

·

·

·

17/42

MultipleDispatch(contd)

julia>methods(+)#171methodsforgenericfunction"+":+(x::Bool)atbool.jl:33+(x::Bool,y::Bool)atbool.jl:36+(y::AbstractFloat,x::Bool)atbool.jl:46+(x::Int64,y::Int64)atint.jl:8+(x::Int8,y::Int8)atint.jl:16+(x::UInt8,y::UInt8)atint.jl:16+(x::Int16,y::Int16)atint.jl:16+(x::UInt16,y::UInt16)atint.jl:16+(x::Int32,y::Int32)atint.jl:16+(x::UInt32,y::UInt32)atint.jl:16+(x::UInt64,y::UInt64)atint.jl:16

makingthefirstobjectimportantiscounter-intuitiveinscientificoperations

alloperatorsaredefinedasfunctions

·

·

18/42

IntegratewithOtherLanguages

julia>x=ccall((:rand,"libc"),Int32,())719885386

julia>usingPyCalljulia>@pyimportmathaspymathjulia>pymath.exp(1)2.718281828459045

19/42

UmbrellaOrganizationsonGithub

JuliaStats,JuliaOpt,JuliaParallel,JuliaDB,JuliaGPU,BioJulia,JuliaQuantum,JuliaAstro,JuliaQuant,JuliaSparse,JuliaDiff,JuliaWeb,JuliaDSP,JuliaGraphs

20/42

Tooling

AtomEditor?

[…]wethinkwecanhaveourcakeandeatittoobybuildingontopoftheexcellentAtomeditor(JuliaBlog,Jan72016)

22/42

EditorandOutlineView

23/42

Juliainterpreters

24/42

Juliarunconfigurations

25/42

Wewantittobeinteractive?

interactiveconsolemissing

nographicwindow

trickysincerequirescommunicationwithJava

wehavebeentherewithourRtoolingforEclipse

·

·

·

·

26/42

Jupyter

Jupyternotebooks

https://losc.ligo.org/s/events/GW150914/GW150914_tutorial.html28/42

tmpnbserver

29/42

JupyterConsolePlugin

developJSONmodelimplementingtheJupyterprotocol

developZMQinterfacetointeractwithkernels

developaWebSocketinterfacetointeractwithkernels

EclipseUIforconsoleandJupytergraphicsview

·

·

·

·

30/42

2+2inJulia

31/42

2+2inPython

32/42

2+2inR

33/42

2+2inRuby

34/42

2+2inbash

35/42

2+2in…

http://jupyter.org

36/42

2+2?

37/42

Conclusions

Conclusions

https://github.com/JuliaComputing/JuliaDT/releases/tag/v0.0.1http://jupyter-console.openanalytics.eu(updatesite)

Juliaishot…ashell

ItisEclipse-Ready

Jupyteriscool

ItisEclipse-Ready

·

·

·

·

39/42

Acknowledgements

Juliadevelopers

Jupyterproject

DavidDossot(Apple)

FrederickMichielssen(OpenAnalytics)

ScienceWorkingGroup

·

·

·

·

·

40/42

Questions?

[email protected]

41/42

Thanks!

42/42