0% found this document useful (0 votes)
3 views

COMP3007 Modern Programming Languages Week1

The document outlines the COMP3007 course on Modern Programming Languages, focusing on Rust and Go. It covers the history, development, and key features of both languages, emphasizing Rust's memory safety and Go's simplicity and concurrency. The course will include in-depth studies of Rust and Go over several weeks, along with practical assignments and evaluations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

COMP3007 Modern Programming Languages Week1

The document outlines the COMP3007 course on Modern Programming Languages, focusing on Rust and Go. It covers the history, development, and key features of both languages, emphasizing Rust's memory safety and Go's simplicity and concurrency. The course will include in-depth studies of Rust and Go over several weeks, along with practical assignments and evaluations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

COMP3007 - Modern Programming Languages

Week 1: Introduction to Modern Programming Languages

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel

Department of Computer Engineering

Fall 2024-2025

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 1 / 25
Outline

1 Introduction to Modern Programming Languages

2 Rust: History and Development

3 Go: Overview and History

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 2 / 25
Introduction

Overview of the course content.


Importance of learning new programming languages.
Brief history of Rust and Go.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 3 / 25
Rust - Development Background

Initially designed by Graydon Hoare in 2006 as a personal project.


Mozilla began sponsoring the project in 2009.
Rust’s primary goal: Safe concurrency and memory safety without a
garbage collector.
First stable release (1.0) was launched in May 2015.

Rust and Cargo trademarks are property of Rust Foundation.


https://foundation.rust-lang.org/policies/logo-policy-and-media-guide/
Ferris the crab is the unofficial mascot

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 4 / 25
People Behind Rust

Graydon Hoare - Original creator of


Rust.
Mozilla - Sponsored the project and
provided resources for its development.
Rust Core Team - Manages the
direction of the language.
Rust community - Actively contributes
to language development.
Graydon Hoare, the original
Rust Foundation - Established in 2021,
creator of Rust. He is not a
provides financial and legal support for Benevolent Dictator For Life
Rust.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 5 / 25
Rust Governance

Rust is governed by a core team, a language team, and other


domain-specific teams.
Governance is community-driven with an open RFC (Request for
Comments) process.
New features and changes are discussed and developed openly within
the community.
Graydon Hoare’s blog: ”The Rust I Wanted Had No Future”
https://graydon2.dreamwidth.org/307291.html

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 6 / 25
Rust Version History

Rust 1.0 (2015): The first stable release; focus on core safety and
performance.
Rust 1.26 (2018): Introduced impl Trait, allowing for more
expressive and ergonomic code.
Rust 1.31 (2018): Released the 2018 edition with module system
improvements and procedural macros.
Rust 1.39 (2019): Introduced async/await syntax for better
concurrency support.
Rust 1.50 (2021): Continued improvements in const functions,
stabilization of various features.
Rust 1.60+ (2022-2024): Focus on performance improvements,
safety, and continued evolution of async capabilities.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 7 / 25
Key Features of Rust by Version

Rust 1.0: Safe memory access, ownership model, and performance.


Rust 1.26: impl Trait for easier generic programming.
Rust 1.31: 2018 edition with improved module system and
ergonomic features.
Rust 1.39: async/await for asynchronous programming.
Rust 1.50: Advanced const functions and stabilization.
Latest versions: Focus on further improvements in async,
performance, and developer experience.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 8 / 25
Why Rust?

Addressing limitations of traditional languages like C/C++, i.e.


memory safety.
Rust: Focus on safety and concurrency without a garbage collector.
Increasing adoption in systems programming, web development (via
WebAssembly), and more.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 9 / 25
NSA’s Recommendation: Transition to Rust

NSA Guidance (2023): The NSA recommends organizations


transition from memory-unsafe languages like C/C++ to
memory-safe languages, particularly Rust.
Reasoning: Memory safety issues in C/C++ often lead to
vulnerabilities that can be exploited for remote code execution and
other security breaches.
Impact: While Rust is favored for new projects, C/C++ will continue
in legacy systems, but Rust is encouraged for its security advantages.
Industry Trend: Reflects a growing industry trend towards adopting
memory-safe languages to enhance cybersecurity.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 10 / 25
Introduction to WebAssembly (Wasm)

What is WebAssembly?: A binary instruction format for a


stack-based virtual machine, designed to execute at near-native speed
in web browsers.
Purpose: Allows high-performance applications (like games or
complex calculations) to run on the web with efficiency.
Browser Support: Supported by all major browsers, including
Chrome, Firefox, Edge, and Safari.
Language Support: Compilers are available for many languages,
including Rust, C, C++, and Go.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 11 / 25
WebAssembly and Rust

Rust’s Role: Rust is often used with WebAssembly because of its


strong performance, safety, and compatibility with Wasm’s needs.
Memory Safety: Rust’s guarantees make it ideal for compiling to
WebAssembly, reducing potential runtime errors.
Use Cases: WebAssembly + Rust is used in web apps, games, and
serverless functions to improve performance and security.
Tooling: Tools like ‘wasm-bindgen‘ and ‘wasm-pack‘ simplify building
and integrating Rust with WebAssembly.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 12 / 25
Advantages of WebAssembly

Performance: Runs at near-native speed by leveraging the browser’s


capabilities.
Portability: Write code once, run it on any platform that supports
WebAssembly.
Interoperability: Integrates seamlessly with JavaScript, allowing
developers to use Wasm modules in web applications.
Security: Sandboxed execution environment ensures that
WebAssembly code runs securely, minimizing risks.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 13 / 25
Future of WebAssembly

Beyond Browsers: WebAssembly is expanding beyond web browsers


to other environments like server-side applications, IoT, and even
blockchain.
WASI (WebAssembly System Interface): A modular system
interface for WebAssembly, enabling it to be used in a variety of
systems beyond the browser.
Growing Ecosystem: Increasing support from major companies and
projects, including Mozilla, Fastly, and Cloudflare.
Community and Standards: Active community driving the evolution
of WebAssembly through the World Wide Web Consortium (W3C).

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 14 / 25
Go - Development Background

Created by Robert Griesemer, Rob Pike, and Ken Thompson at


Google in 2007.
Released as an open-source project in 2009.
Designed to improve programming productivity in an era of multicore
processors and large codebases.
Emphasis on simplicity, efficiency, and concurrency.

Go logo Golang Mascot:Gopher

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 15 / 25
Go - Version History

Go 1.0 (2012): The first stable release, establishing Go’s


foundational features.
Go 1.5 (2015): Removal of C dependencies, Go compiler written in
Go.
Go 1.7 (2016): Introduction of context package for better
management of goroutines.
Go 1.11 (2018): Modules introduced as the official dependency
management system.
Go 1.13 (2019): Improved error handling with new error wrapping
features.
Go 1.18 (2022): Introduction of generics, a long-awaited feature.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 16 / 25
Future Directions of Go

Continued improvements in the generics system.


Focus on reducing binary sizes and improving compilation times.
Enhancing support for large-scale distributed systems.
Ongoing development of tools for better debugging, profiling, and
testing.
Community-driven features through Go proposals (Go Proposals
Process).

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 17 / 25
Go Version 2: Overview

Go 2 aims to improve upon Go 1 with a focus on developer


experience, but without breaking compatibility.
The Go team prioritizes backward compatibility, so most Go 1 code
will continue to work in Go 2.
Enhancements are likely to be evolutionary rather than revolutionary,
addressing limitations identified in Go 1.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 18 / 25
Differences Between Go 1 and Go 2

Generics: Introduced in Go 1.18, will be refined in Go 2 with


potential new features and optimizations.
Error Handling: Go 2 may introduce new patterns or syntax for more
expressive and robust error handling.
Tooling Enhancements: Go 2 is expected to include better tooling
for testing, debugging, and profiling.
Language Simplifications: Possible removal or revision of features
that are rarely used or have proven problematic.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 19 / 25
Compatibility Considerations

Backward Compatibility: Go 2 is designed with backward


compatibility in mind. Most Go 1.x code will work with Go 2.
Transitioning to Go 2: Migration tools and guides will be provided
to help developers transition their codebases.
Feature Flags: Some new features in Go 2 may be optional, allowing
developers to adopt them gradually.
Deprecation Policy: Certain rarely used or problematic features
might be deprecated, but with long transition periods.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 20 / 25
Key Properties of Go

Simple and clean syntax.


Built-in concurrency primitives (goroutines and channels).
Fast compilation.
Robust standard library.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 21 / 25
Comparative Study: Rust vs. Go

Rust: Systems programming focus.


Go: Designed for cloud-native and microservices.
Performance comparison.
Community and ecosystem.

We’ll go deeply over this in Week 2!

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 22 / 25
Course Structure Overview

Week 1-2: Introduction to Rust and Go.


Week 3-8: In-depth study of Rust.
Week 9-14: In-depth study of Go.
Assignments, project work, and evaluations.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 23 / 25
Conclusion

Excited to explore Rust and Go.


Overview of the learning journey ahead.
Q&A session.

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 24 / 25
Thank You!

Dr. Öğr. Üyesi Yusuf Kürşat Tuncel (Department


COMP3007
of Computer
- Modern
Engineering)
Programming Languages Fall 2024-2025 25 / 25

You might also like