Files
JuliaKurs23/nb/intro.ipynb
T
2023-05-12 20:12:56 +02:00

3.1 KiB

Cell:
[Cell type raw - unsupported, skipped]

Noch eine Programmiersprache?

Die Ziele der Schöpfer von Julia kann man in Why we created Julia nachlesen. Kurzfassung:

“We want a language that is

open source with the speed of C obvious, familiar mathematical notation like Matlab as usable for general programming as Python as easy for statistics as R as natural for string processing as Perl as powerful for linear algebra as Matlab as good at gluing programs together as the shell dirt simple to learn, yet keeps the most serious hackers happy”

"Wir wollen eine Sprache, die

  • open source ist
  • die Geschwindigkeit von C hat
  • obvious, familiar mathematical notation like Matlab
  • as usable for general programming as Python
  • as easy for statistics as R
  • as natural for string processing as Perl
  • as powerful for linear algebra as Matlab
  • as good at gluing programs together as the shell
  • dirt simple to learn, yet keeps the most serious hackers happy"

vs code: erzeuge eine Datei mit der Endung .jl, starte ein REPL mit dem Kommando Alt-Enter am Ende einer Zeile oder Anweisung f"uhrt dazu, dass die Anweisung is REPL kopiert und ausgefuehrt wird

alt-enter execute in julia Repl shift-enter: ex. and move to next line

die Erstinstallation von Paketen kann sehr lange dauern.

im Jupyterhub sind die im Kurs nenötigten Pakete vorinstalliert.

colored console graphs produced by Benchmarktools.jl

In [ ]:
using BenchmarkTools

@benchmark sum(rand(1000))

structure of floating point numbers

In [ ]:
function printbitsf64(x::Float64)
    s = bitstring(x)
    printstyled(s[1], color = :blue, reverse=true)
    printstyled(s[2:12], color = :green, reverse=true)
    printstyled(s[13:end], color=:red, bold=true, reverse=true)
    print("\n")
end

printbitsf64(27.56640625)