eclipse tooling for julia - eclipsecon france2018 tooling for julia tobias verbeke ... 4 people at...
TRANSCRIPT
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(contd.)
femtolisp:parserwritteninaveryefficientSchemedialect
C/c++core:dealswithLLVMback-endwork
dependenciesonthetraditionalscientificcomputinglibraries(LAPACKandOpenBLASforlinearalgebraoperationsetc.)
alltherest:pureJulia
·
·
·
·
12/42
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
AtomEditor?
[…]wethinkwecanhaveourcakeandeatittoobybuildingontopoftheexcellentAtomeditor(JuliaBlog,Jan72016)
22/42
Wewantittobeinteractive?
interactiveconsolemissing
nographicwindow
trickysincerequirescommunicationwithJava
wehavebeentherewithourRtoolingforEclipse
·
·
·
·
26/42
JupyterConsolePlugin
developJSONmodelimplementingtheJupyterprotocol
developZMQinterfacetointeractwithkernels
developaWebSocketinterfacetointeractwithkernels
EclipseUIforconsoleandJupytergraphicsview
·
·
·
·
30/42
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