Rust is a systems programming language that provides memory safety without using a garbage collector. It achieves memory safety through rules of ownership, borrowing, and lifetimes that are checked at compile time. These rules prevent common memory bugs like memory leaks, dangling pointers, and use-after-free errors that are common in C and C++.
Back in 2015, Square and Google collaborated to launch gRPC, an open source RPC framework backed by protocol buffers and HTTP/2, based on real-world experiences operating microservices at scale. If you build microservices, you will be interested in gRPC.
This webcast covers:
- a technical overview of gRPC
- use cases and applicability in your stack
- a deep dive into the practicalities of operationalizing gRPC
This presentation was held at the Stockholm Rust Meetup in September 2019.
This is a brief introduction to Rust and highlights some of the problems with C++ that it attempts to solve. It also contain a brief introduction to the ownership model and the borrow checker that Rust uses.
Rust is the new kid on the block. It's a system programming language that is blazingly fast and offers powerful high-level abstractions better known from dynamic languages like Ruby or Python. Rust offers memory safety without a Garbage Collector and makes low-level programming easier and more secure. I will give an introductory talk about Rust and show some of its nicest features.
Back in 2015, Square and Google collaborated to launch gRPC, an open source RPC framework backed by protocol buffers and HTTP/2, based on real-world experiences operating microservices at scale. If you build microservices, you will be interested in gRPC.
This webcast covers:
- a technical overview of gRPC
- use cases and applicability in your stack
- a deep dive into the practicalities of operationalizing gRPC
This presentation was held at the Stockholm Rust Meetup in September 2019.
This is a brief introduction to Rust and highlights some of the problems with C++ that it attempts to solve. It also contain a brief introduction to the ownership model and the borrow checker that Rust uses.
Rust is the new kid on the block. It's a system programming language that is blazingly fast and offers powerful high-level abstractions better known from dynamic languages like Ruby or Python. Rust offers memory safety without a Garbage Collector and makes low-level programming easier and more secure. I will give an introductory talk about Rust and show some of its nicest features.
Rust
Why do you care about Rust? Who has the time to learn all these new languages? It seems like a new one is popping up every other week and this trend is growing at an exponential rate. Good news, a fair number of them are crafted really well and efficiently solve specific problems. Bad news, how do you keep up with all of this, let alone decide which languages to include in your companies technology portfolio.
Despite the challenges of all these new languages, a majority of developers are intrigued about the idea of becoming a polyglot, but don't know where to begin or don't have the time. In my polyglot travels, there is one language of late that is the sure-fire answer to the above questions, Rust.
In this talk I’ll explore the value behind becoming more polyglotic as a developer, how to pick languages to learn, and then dive deep in the the language of Rust. Which in my opinion, is hands down the best up and coming languages to learn.
About the Presenter
Anthony Broad-Crawford has been a developer since the year 2000 with a short side stint as a semi-professional poker player. Since his transition to software development Anthony has...
1. Built 8 patent receiving technologies
2. Founded two global companies
3. Been a CTO (3x), CPO (1x), and CEO (1x)
and is currently the CTO at Fooda where he manages product, user experience, and engineering. Fooda is predominantly web and mobile technology company focused on bringing great & healthy food from the best restaurant's to people while at the office.
Through his career, in production applications Anthony has used Ruby, Java, Jave (Android), Objective-C and Swift, .NET, Erlang, Scala, Node.JS, LISP, Smalltalk, and even assembly, with his recent favorite, Rust . No, not all at the same time in the same application.
Anthony now spends his time building great teams, that leverage great technology, to build great products, but still looks to codes every chance he can get :)
This year ECMA International will be ratifying the biggest update to the JavaScript language in its history. In this talk we'll look at key features already appearing in browsers as well as those coming in the near future. We'll also explore how you can begin leveraging the power of ES6 across all browsers today. If you haven't looked at JavaScript recently, you soon realize that a bigger, better world awaits.
Brief overview of the Rust system programming language. Provides a concise introduction of its basic features, with an emphasis on its memory safety features (ownership, moves, borrowing) and programming style with generic functions, structures, and traits.
Here are slides from basic training for Gradle.
This training is aimed to help Java Developers to get hands-on experience to use Gradle as a primary build tool for Java source code starting from simple compilation continuing with different kinds of tests and finishing with code quality analysis and artefacts publishing.
A presentation of what are JavaScript Promises, what problems they solve and how to use them. Dissects some Bluebird features, the most complete Promise library available for NodeJS and browser.
Rust Tutorial | Rust Programming Language Tutorial For Beginners | Rust Train...Edureka!
( ** Edureka Online Training: https://www.edureka.co/ ** )
This video on Rust Programming Language will help you understand basics of Rust programming. The following topics will be covered in this tutorial:
1. Why learn Rust?
2. What is Rust?
3. Install Rust
4. Rust Fundamentals
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
An introduction to Rust: the modern programming language to develop safe and ...Claudio Capobianco
Rust is a young programming language developed by Mozilla with the open source community support. According to a survey of StackOverflow, in 2016 was the most loved among developers language! The goal of Rust is to combine control and performances, that is, operate at low level with high-level constructs. The actual applications vary from operating system to web development. Rust natively includes tools for Agile development, such as dependency management, testing and much more. The gap with other popular languages is filling up quickly thanks to the community, very active and fantastic :)
In this introductory presentation we will discuss the characteristics that make Rust unique, including the concepts of Ownership, Borrowing, and Lifetimes.
These slide has be presented for a talk in BIC Lazio Casilina, that has been also the first meetup of Rust Rome!
gRPC in Golang presentation
In this talk, I introduced gRPC, Protocol buffer, and how to use them with golang.
Source code used in the presentation: http://github.com/AlmogBaku/grpc-in-go
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/28XnVtb.
Felix Klock describe the core concepts of the Rust language (ownership, borrowing, and lifetimes), as well as the tools beyond the compiler for open source software component distribution (cargo, crates.io). Filmed at qconlondon.com.
Felix Klock is a research engineer at Mozilla, where he works on the Rust compiler, runtime libraries, and language design. He previously worked on the ActionScript Virtual Machine for the Adobe Flash runtime. Klock is one of the developers of the Larceny Scheme language runtime.
A basic Introduction to Rust. Rust is a modern system programming language which offering different approach than other existing new modern system programming languages to deal with: memory safety without GC, abstraction without overhead, and concurrency without data races.
Rust
Why do you care about Rust? Who has the time to learn all these new languages? It seems like a new one is popping up every other week and this trend is growing at an exponential rate. Good news, a fair number of them are crafted really well and efficiently solve specific problems. Bad news, how do you keep up with all of this, let alone decide which languages to include in your companies technology portfolio.
Despite the challenges of all these new languages, a majority of developers are intrigued about the idea of becoming a polyglot, but don't know where to begin or don't have the time. In my polyglot travels, there is one language of late that is the sure-fire answer to the above questions, Rust.
In this talk I’ll explore the value behind becoming more polyglotic as a developer, how to pick languages to learn, and then dive deep in the the language of Rust. Which in my opinion, is hands down the best up and coming languages to learn.
About the Presenter
Anthony Broad-Crawford has been a developer since the year 2000 with a short side stint as a semi-professional poker player. Since his transition to software development Anthony has...
1. Built 8 patent receiving technologies
2. Founded two global companies
3. Been a CTO (3x), CPO (1x), and CEO (1x)
and is currently the CTO at Fooda where he manages product, user experience, and engineering. Fooda is predominantly web and mobile technology company focused on bringing great & healthy food from the best restaurant's to people while at the office.
Through his career, in production applications Anthony has used Ruby, Java, Jave (Android), Objective-C and Swift, .NET, Erlang, Scala, Node.JS, LISP, Smalltalk, and even assembly, with his recent favorite, Rust . No, not all at the same time in the same application.
Anthony now spends his time building great teams, that leverage great technology, to build great products, but still looks to codes every chance he can get :)
This year ECMA International will be ratifying the biggest update to the JavaScript language in its history. In this talk we'll look at key features already appearing in browsers as well as those coming in the near future. We'll also explore how you can begin leveraging the power of ES6 across all browsers today. If you haven't looked at JavaScript recently, you soon realize that a bigger, better world awaits.
Brief overview of the Rust system programming language. Provides a concise introduction of its basic features, with an emphasis on its memory safety features (ownership, moves, borrowing) and programming style with generic functions, structures, and traits.
Here are slides from basic training for Gradle.
This training is aimed to help Java Developers to get hands-on experience to use Gradle as a primary build tool for Java source code starting from simple compilation continuing with different kinds of tests and finishing with code quality analysis and artefacts publishing.
A presentation of what are JavaScript Promises, what problems they solve and how to use them. Dissects some Bluebird features, the most complete Promise library available for NodeJS and browser.
Rust Tutorial | Rust Programming Language Tutorial For Beginners | Rust Train...Edureka!
( ** Edureka Online Training: https://www.edureka.co/ ** )
This video on Rust Programming Language will help you understand basics of Rust programming. The following topics will be covered in this tutorial:
1. Why learn Rust?
2. What is Rust?
3. Install Rust
4. Rust Fundamentals
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
An introduction to Rust: the modern programming language to develop safe and ...Claudio Capobianco
Rust is a young programming language developed by Mozilla with the open source community support. According to a survey of StackOverflow, in 2016 was the most loved among developers language! The goal of Rust is to combine control and performances, that is, operate at low level with high-level constructs. The actual applications vary from operating system to web development. Rust natively includes tools for Agile development, such as dependency management, testing and much more. The gap with other popular languages is filling up quickly thanks to the community, very active and fantastic :)
In this introductory presentation we will discuss the characteristics that make Rust unique, including the concepts of Ownership, Borrowing, and Lifetimes.
These slide has be presented for a talk in BIC Lazio Casilina, that has been also the first meetup of Rust Rome!
gRPC in Golang presentation
In this talk, I introduced gRPC, Protocol buffer, and how to use them with golang.
Source code used in the presentation: http://github.com/AlmogBaku/grpc-in-go
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/28XnVtb.
Felix Klock describe the core concepts of the Rust language (ownership, borrowing, and lifetimes), as well as the tools beyond the compiler for open source software component distribution (cargo, crates.io). Filmed at qconlondon.com.
Felix Klock is a research engineer at Mozilla, where he works on the Rust compiler, runtime libraries, and language design. He previously worked on the ActionScript Virtual Machine for the Adobe Flash runtime. Klock is one of the developers of the Larceny Scheme language runtime.
A basic Introduction to Rust. Rust is a modern system programming language which offering different approach than other existing new modern system programming languages to deal with: memory safety without GC, abstraction without overhead, and concurrency without data races.
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
Dopo 20 anni Java inizia a sentire il peso degli anni e la sua sintassi non evolve come vorremmo, ma la JVM resta sempre un ambiente affidabile ed è già in produzione presso moltissime aziende. Negli ultimi anni sono usciti molti linguaggi basati sulla JVM, ma non tutti hanno avuto il successo sperato. Kotlin ha conquistato Android e, ora, grazie a una sintassi intuitiva e grandi aziende che lo supportano potrebbe essere molto utilizzato anche nelle applicazioni web. Durante il talk vedremo le basi del linguaggio e come sviluppare una applicazione web pronta ad andare in produzione.
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)AvitoTech
В своём докладе Влад будет говорить об использовании STL, управлении памятью, как работает ARC и C++, лямбды и блоки. И самое главное: где и как можно «выстрелить себе в ногу».
Apache Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform aimed at improving developer productivity thanks to a concise, familiar and easy to learn syntax. It integrates smoothly with any Java program, and immediately delivers to your application powerful features, including scripting capabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functional programming.
In this presentation, we'll see how Groovy simplifies the life of Java Developers. Basically, this talk would be for beginners where I would introduce powerful Groovy concepts like - Groovy Collections, Closure, Traits etc.
Kotlin: forse è la volta buona (Trento)Davide Cerbo
Il codice di esempio e disponibile qui: https://github.com/jesty/kotlin-fossavotabona
La variazione col DAO al posto del repository è disponibile qui:
https://github.com/jesty/kotlin-fossavotabona/tree/dao-companion-object
Use C++ to Manipulate mozSettings in GeckoChih-Hsuan Kuo
If you want to manipulate mozSettings with JavaScript, you can reference to Settings API on MDN (https://developer.mozilla.org/en-US/docs/Web/API/Settings_API).
But if you want to manipulate it with C++, we can only reference to the codebase of Gecko. Now, let me show you some example.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
11. Rule 1
Each Value Has Only ONE Owner
Rule 2
Variable Releases OWNING VALUE when Destroying
Rule 3
Not Allow to Use INVALID Variables
not owning or borrowing any value
INVALID
14. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
→ fn main() {
let a = vec![1; 5];
let b = a;
{
let c = b;
}
let d = vec![2; 5];
foo(d);
}
variables
values
15. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
→ let a = vec![1; 5];
let b = a;
{
let c = b;
}
let d = vec![2; 5];
foo(d);
}
a
vec![1;5]
variables
values
16. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
→ let b = a;
{
let c = b;
}
let d = vec![2; 5];
foo(d);
}
a b
vec![1;5]
variables
values
17. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = a;
{
→ let c = b;
}
let d = vec![2; 5];
foo(d);
}
a b c
vec![1;5]
variables
values
18. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = a;
{
let c = b;
}
→ let d = vec![2; 5];
foo(d);
}
a b c d
variables
values
vec![2;5]
19. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = a;
{
let c = b;
}
let d = vec![2; 5];
→ foo(d);
}
a b c d
variables
values
vec![2;5]
20. → fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = a;
{
let c = b;
}
let d = vec![2; 5];
foo(d);
}
a b c d v
variables
values
vec![2;5]
21. fn foo(v: Vec<i32>) {
→ println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = a;
{
let c = b;
}
let d = vec![2; 5];
foo(d);
}
a b c d v
variables
values
vec![2;5]
22. fn foo(v: Vec<i32>) {
println!("{:?}", v);
→ }
fn main() {
let a = vec![1; 5];
let b = a;
{
let c = b;
}
let d = vec![2; 5];
foo(d);
}
a b c d
variables
values
23. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = a;
{
let c = b;
}
let d = vec![2; 5];
foo(d);
→ }
variables
values
25. fn foo(v: Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a: Vec<i32>;
→ println!("{:?}", a);
let b = vec![1; 5];
let c = b;
→ println!("{:?}", b);
}
error[E0381]: use of possibly
uninitialized variable: `a`
--> src/main.rs:7:22
|
7 | println!("{:?}", a);
| ^ use of
| possibly uninitialized `a`
error[E0382]: use of moved value: `b`
--> src/main.rs:11:22
|
10 | let c = b;
| - value moved here
11 | println!("{:?}", b);
| ^ value used
|. here after move
|
28. fn foo(v: i32) {
println!("{:?}", v);
}
→ fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
29. fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
→ let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
a
10
30. fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
let a = 10;
→ let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
a b
10 10
31. fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
let a = 10;
let b = a;
→ println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
a b
10 10
32. fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
→ let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
a b c
10 10 20
33. fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
→ foo(c);
println!("{:?}", c);
}
variables
values
a b c
10 10 20
34. → fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
a b c v
10 10 20 20
35. fn foo(v: i32) {
→ println!("{:?}", v);
}
fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
a b c v
10 10 20 20
36. fn foo(v: i32) {
println!("{:?}", v);
→ }
fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
}
variables
values
a b c
10 10 20
37. fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
→ println!("{:?}", c);
}
variables
values
a b c
10 10 20
38. fn foo(v: i32) {
println!("{:?}", v);
}
fn main() {
let a = 10;
let b = a;
println!("{:?}", a);
let c = 20;
foo(c);
println!("{:?}", c);
→ }
variables
values
45. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
→ fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
46. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
→ let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
a
vec![1;5]
47. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
→ let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
a b
vec![1;5]
48. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = &a;
→ println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
a b
vec![1;5]
49. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
→ let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
a b c
vec![2;5]vec![1;5]
50. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
→ foo(&c);
println!("{:?}", c);
}
variables
values
a b c
vec![2;5]vec![1;5]
51. → fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
a b c v
vec![2;5]vec![1;5]
52. fn foo(v: &Vec<i32>) {
→ println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
a b c v
vec![2;5]vec![1;5]
53. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
→ }
fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
}
variables
values
a b c
vec![2;5]vec![1;5]
54. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
→ println!("{:?}", c);
}
variables
values
a b c
vec![2;5]vec![1;5]
55. fn foo(v: &Vec<i32>) {
println!("{:?}", v);
}
fn main() {
let a = vec![1; 5];
let b = &a;
println!("{:?}", a);
let c = vec![2; 5];
foo(&c);
println!("{:?}", c);
→ }
variables
values
58. Project Initialization
$ cargo new helloworld --bin
Create a new project with Cargo:
Generated files by `cargo new`:
$ tree helloworld
helloworld
!"" Cargo.toml
#"" src
#"" main.rs
59. Build & Run
$ cargo build
Compiling helloworld v0.1.0 (file:///helloworld)
Finished dev [unoptimized + debuginfo] target(s) in 4.60 secs
Build a project with cargo:
Run the executable program:
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/helloworld`
Hello, world!
60. Cargo.toml
[package]
# project name
name = "helloworld"
# project version
version = "0.1.0"
# auto info
authors = ["kuoe0 <kuoe0.tw@gmail.com>"]
[dependencies]
rand = "0.4.2" # random number generator
61. Cargo.toml
[package]
# project name
name = "helloworld"
# project version
version = "0.1.0"
# auto info
authors = ["kuoe0 <kuoe0.tw@gmail.com>"]
[dependencies]
rand = "0.4.2" # random number generator
Package Info
Dependencies List
62. Dependencies List
[package]
# project name
name = "helloworld"
# project version
version = "0.1.0"
# auto info
authors = ["kuoe0 <kuoe0.tw@gmail.com>"]
[dependencies]
rand = "0.4.2"
libc = "0.2.40"
bitflags = "1.0.3"
serde = "1.0.44"
log = "0.4.1"
64. Unit Test
extern crate rand;
fn gen_rand_int_less_100() -> u32 {
rand::random::<u32>() % 100
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn should_less_100() {
assert!(gen_rand_int_less_100() < 100);
}
}
65. $ cargo test
Compiling helloworld v0.1.0 (file:///private/tmp/helloworld)
Finished dev [unoptimized + debuginfo] target(s) in 0.48 secs
Running target/debug/deps/helloworld-7a8984a66f00dd7b
running 1 test
test tests::should_less_100 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0
filtered out
Run unit test with `cargo test`
66. Documentation
extern crate rand;
/// Return a random number in [0, 100)
///
/// # Example
///
/// ```
/// let r = gen_rand_int_less_100();
/// ```
pub fn gen_rand_int_less_100() -> u32 {
rand::random::<u32>() % 100
}
67. $ cargo doc
Documenting helloworld v0.1.0 (file:///private/tmp/helloworld)
Finished dev [unoptimized + debuginfo] target(s) in 1.14 secs
Generate the document with `cargo doc`
71. Servo Browser Engine
A browser engine written in Rust with parallel mechanism
Quantum CSS (a.k.a. Stylo)
Use the parallel style engine from Servo in Firefox