Skip to content
By using Twitter’s services you agree to our Cookies Use. We and our partners operate globally and use cookies, including for analytics, personalisation, and ads.
  • Home Home Home, current page.
  • About

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
SebAaltonen's profile
Sebastian Aaltonen
Sebastian Aaltonen
Sebastian Aaltonen
@SebAaltonen

Tweets

Sebastian Aaltonen

@SebAaltonen

Co-founder of Second Order LTD. Indie game developer. ex-Ubisoft senior rendering lead.

Helsinki, Finland
secondorder.com
Joined August 2015

Tweets

  • © 2019 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    Sebastian Aaltonen‏ @SebAaltonen Jan 25

    Started learning Rust. First thing I noticed in tutorial: Variables are immutable (const) by default. This is a good start. Woohoo! :)

    10:30 AM - 25 Jan 2019
    • 45 Retweets
    • 370 Likes
    • Peter Morley J. Brad Byrd Jalal Chachoua Kevin McDowell Vosvek mushu λ♥! Evan Prodromou Dávid Komorowicz ✈️ GDC 2019 Fabien Ninoles
    34 replies 45 retweets 370 likes
      1. New conversation
      2. Sebastian Aaltonen‏ @SebAaltonen Jan 25

        UTF-8 formatted strings! Awesome :)

        1 reply 3 retweets 39 likes
        Show this thread
      3. Sebastian Aaltonen‏ @SebAaltonen Jan 25

        Yay! No exceptions. Rust functions return error codes. You get a compiler warning if you forget to use the return value :)

        5 replies 4 retweets 53 likes
        Show this thread
      4. Sebastian Aaltonen‏ @SebAaltonen Jan 25

        A single standard build tool with dependency tracking. Downloads proper versions of used libraries (crates) and all their dependencies. C/C++ still has no de-facto standard for either. People copy paste code under random directories to their own repositories.

        6 replies 2 retweets 52 likes
        Show this thread
      5. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Rust has strong static type system. Compiler is also able to track resource ownership and threading issues. Big improvement over C++. Reduces need of unit tests. I wouldn’t call unit tests ”automatic” as you need to write + maintain them. Compiler is automatic, no added inertia.

        4 replies 3 retweets 26 likes
        Show this thread
      6. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Rust has sane integers. Nice names, instead of monsters like uint32_t. Bit depth is well defined (except usize and isize with are arch ptr sized). Overflow is 2s complement (not UB). Overflow is checked in debug mode (unless wrapping_ or saturating_ operations are used).pic.twitter.com/NEheowWsUS

        3 replies 5 retweets 68 likes
        Show this thread
      7. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Rust has binary literals: 0b1111_0000_0101_0101. No need to decrypt hex numbers in your head to understand bit masks. You can also use underscores in numeric literals to improve readability.

        5 replies 2 retweets 44 likes
        Show this thread
      8. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Integers don’t convert automatically to bool. Too bad C++ inherited this horrible property from C. Writing ”number != 0” is clear and type safe (get error in case a future refactoring changes assumptions).pic.twitter.com/ci4yY4Pytz

        3 replies 1 retweet 35 likes
        Show this thread
      9. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        If is an expression, no need for messy ”cond ? A : B” syntax. All brackets (code blocks) are expressions too. Value is the final expression inside the code block (no semicolor after it). Allows writing expressions with internal named temp variables (naming is good for reading).

        5 replies 1 retweet 25 likes
        Show this thread
      10. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Only one allowed mutable ref (or N immutable refs) mechanism is ingenious! Guarantees no aliasing (allows better codegen) and guarantees no race conditions. Heap is RAII with auto move (similar to unique_ptr), but compiler tracks vars & refs -> error for misuse. Huge improvement.

        3 replies 2 retweets 27 likes
        Show this thread
      11. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Rust has nice features such as enumerate for iter. Returns tuple of both index and element (item). Nice when you need to know the index of the loop iteration. for (i, &item) in bytes.iter().enumerate() ...

        2 replies 1 retweet 21 likes
        Show this thread
      12. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Rust has good built-in tuples, and destructuring tuples has nice syntax. For example function returning tuple (multiple values) + destructuring the return value to a and b: fn addsub(x: i32, y: i32) -> (i32, i32) { (x + y, x - y) } let (a, b) = addsub(1, 2);

        2 replies 1 retweet 22 likes
        Show this thread
      13. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        C++ lacks span type (ptr + size) until C++20. We’ve had our own span impl and it’s very nice. Rust is even better with built-in slice types (array & string). Rust borrow rules apply also to slices (compile error for stale slices)! Syntax is nice: &a[..] <-whole &a[3..7] <-sub

        1 reply 1 retweet 18 likes
        Show this thread
      14. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        I love how Rust separates struct data from methods. Easy to see the data layout and add more methods later without bloating the struct. struct Rectangle { width: u32, height: u32, } impl Rectangle { fn area(&self) -> u32 { self.width * self.height } }

        3 replies 2 retweets 57 likes
        Show this thread
      15. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        Rust doesn’t have null pointers. No need to add null safety checks or null asserts anywhere. For the special cases where some data may not exist, you use Option<T>. You can’t accidentally use Option<T> when it is None. You usually use ”match” to handle both Some and None cases.

        4 replies 1 retweet 26 likes
        Show this thread
      16. Sebastian Aaltonen‏ @SebAaltonen Jan 26

        In Rust ”match” is the equivalent of C++ switch case, but with broad pattern match capability. Compiler will give you error if you don’t handle all cases (some pattern in missing). This is nice. Also with Option<T> it means that None case needs to be handled to make code compile.

        8 replies 1 retweet 30 likes
        Show this thread
      17. Sebastian Aaltonen‏ @SebAaltonen Jan 29

        Rust generics are not duck typed like C++ templates. The compiler actually validates that your code compiles regardless of type T. You use trait bounds to define the ”interface” of T. If you do potentially illegal operations to type T the compiler gives you an error.

        4 replies 2 retweets 18 likes
        Show this thread
      18. Sebastian Aaltonen‏ @SebAaltonen Jan 29

        Trait bounds also offer a nice compile time interface mechanism. Compiler is able to track the actual type under the hood without needing to add any runtime code. Generates faster code than C++ interfaces with virtual functions. And type safety is better.

        3 replies 3 retweets 19 likes
        Show this thread
      19. Sebastian Aaltonen‏ @SebAaltonen Jan 29

        I really love how Rust forces the programmer to think about lifetimes, mutable data and races (mutable data accessible by other ref). Compiler validation gives programmer immediate feedback. Try using mutable globals, and you will rethink soon after fighting the compiler :)

        3 replies 5 retweets 24 likes
        Show this thread
      20. Sebastian Aaltonen‏ @SebAaltonen Jan 29

        C++ obj life time bugs, overflow bugs and thread races silently corrupt memory (likely crash later). Can’t reliably catch these with unit tests (incl must crash). Rust enforces life times, disallows races and overflow = panic. Unit tests are more reliable, esp failure tests.

        1 reply 3 retweets 17 likes
        Show this thread
      21. Sebastian Aaltonen‏ @SebAaltonen Jan 29

        Rust needs less (hand written) unit tests and debugging than C++, because Rust: A) is a strongly typed language, B) generics are not duck typed, C) obj/ref lifetime issues = compiler error, D) data races = compiler error. E) array overflows = panic...

        7 replies 2 retweets 25 likes
        Show this thread
      22. Sebastian Aaltonen‏ @SebAaltonen Jan 30

        Like C/C++, Rust uses stack for vars/structs by default. Built-in growing containers (Vec/String) internally alloc elem array from heap, because size is not known at compile time. Stack as default -> similar perf to C/C++. Safety is also better than most slow heap/GC based langs.

        2 replies 2 retweets 9 likes
        Show this thread
      23. Sebastian Aaltonen‏ @SebAaltonen Jan 30

        Rust iterators are safe (can’t be stale). Creating your own iters is simple, syntax is nice, iterators (filters, zips, maps, etc) can be combined seamlessly. In comparison C++20 ranges are messy, have obscenely slow debug perf and extreme compile time:https://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/ …

        3 replies 3 retweets 23 likes
        Show this thread
      24. Sebastian Aaltonen‏ @SebAaltonen Jan 31

        Rust does compile time borrow checking for variables, refs, String, Vec<T>, Box<T> (unique_ptr)... but Rc<T> (shared_ptr) refs are immutable to prevent races. RefCell<T> can be used inside Rc<T> to allow mutation with runtime borrow checking (panic if potential race).

        2 replies 2 retweets 9 likes
        Show this thread
      25. Sebastian Aaltonen‏ @SebAaltonen Feb 2

        Rust unsafe blocks maintain most safety mechanics (such as borrow checker), but allow for example raw pointers. This can be used to implement your own memory abstractions not supported by standard Rust. Unsafe block can be 100% safe if you validate the code correctness robustly.

        1 reply 1 retweet 7 likes
        Show this thread
      26. End of conversation

    Loading seems to be taking a while.

    Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

      Promoted Tweet

      false

      • © 2019 Twitter
      • About
      • Help Center
      • Terms
      • Privacy policy
      • Cookies
      • Ads info