ͨ • झຯ: • ͷͮ͘Γશൠ • 3DϓϦϯλʢ2013ʙʣ • ϘϧμϦϯάʢ2011ʙʣ !2 yuyakato1984 nayutaya About me: Yuya Kato I work as a software engineer since 2000. I'm running my own company, Nayutaya Inc., as the CEO since 2007. My hobbies are: Creating software, hardware and so on. Designing something using 3D printer. Doing bouldering.
:ʮϨϕϧʯݴޠͷ༏ྼΛࣔ͢ͷͰ͋Γ·ͤΜ Java Rust Haskell Abstraction level Low degree of abstraction High degree of abstraction Note: "Level" doesn't express superiority or inferiority of lang.
puts("Hello") } end def hello 3.times { puts("Hello") } end def hello(): for _ in range(3): print("hello") def hello(): for _ in range(3): print(“hello”) --- IndentationError: expected an indented block main = let hello 0 = [] hello n = "hello\n" ++ hello(n - 1) in do putStrLn $ hello(3) main = let hello 0 = [] hello n = "hello\n" ++ hello(n - 1) in do putStrLn $ hello(3) --- parse error (possibly incorrect indentation or mismatched brackets) ΠϯσϯτΛফ͢ͱ Example: indentation Remove indentation
name = "NAME" hello(name) hello(name) Rust fn main() { fn hello(name: String) { println!("hello, {}!", name); } let name = String::from("NAME"); hello(name); hello(name); } error[E0382]: use of moved value: `name` --> src/main.rs:7:9 | 6 | hello(name); | ---- value moved here 7 | hello(name); | ^^^^ value used here after move | = note: move occurs because `name` has type `std::string::String`, which does not implement the `Copy` trait hello, NAME! hello, NAME! Source code: Output: Example: ownership
ཁ͢ΔʹԿͰܭࢉͰ͖Δػցʢೖग़ྗʹ͍ͭͯൣᙝ֎ʣ Ruby Haskell C/C++ Java Turing-completeness ͦͷଞɺ΄ͱΜͲͷݴޠ And most other languages Turing-complete Non-turing-complete What is turing-complete? What is universal turing machine? In short, a machine which can calculate anything. A calculation model which has ability of calculation as equal as universal turing machine.
Something else A language which has peculiar order of reducing A language which always use lazy evaluation A language which has tuple type And so on...