You are in a dark forest with a map and see a light north. Looking at the map is not understood. Looking around reveals a deserted field with a sharp rock. This appears to be a text-based adventure game with basic interactions like looking and moving between locations controlled by user input. The game architecture involves a main loop that asks for user input, performs the requested action, and continues until the game ends or the player dies.
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOMEJulien Fitzpatrick
Learning to program in Ruby was super fun, but I kept hearing people talk about typed languages that are so-called "closer to the metal," like Rust. It seemed intimidating, but I was curious! I built a small, text-based adventure game in both Ruby and Rust, side-by-side, so I could see what the differences and similarities were. I learned a lot, and now I'm here to share it all with you!
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOMEJulien Fitzpatrick
Learning to program in Ruby was super fun, but I kept hearing people talk about typed languages that are so-called "closer to the metal," like Rust. It seemed intimidating, but I was curious! I built a small, text-based adventure game in both Ruby and Rust, side-by-side, so I could see what the differences and similarities were. I learned a lot, and now I'm here to share it all with you!
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...ssuser7dcef0
Power plants release a large amount of water vapor into the
atmosphere through the stack. The flue gas can be a potential
source for obtaining much needed cooling water for a power
plant. If a power plant could recover and reuse a portion of this
moisture, it could reduce its total cooling water intake
requirement. One of the most practical way to recover water
from flue gas is to use a condensing heat exchanger. The power
plant could also recover latent heat due to condensation as well
as sensible heat due to lowering the flue gas exit temperature.
Additionally, harmful acids released from the stack can be
reduced in a condensing heat exchanger by acid condensation. reduced in a condensing heat exchanger by acid condensation.
Condensation of vapors in flue gas is a complicated
phenomenon since heat and mass transfer of water vapor and
various acids simultaneously occur in the presence of noncondensable
gases such as nitrogen and oxygen. Design of a
condenser depends on the knowledge and understanding of the
heat and mass transfer processes. A computer program for
numerical simulations of water (H2O) and sulfuric acid (H2SO4)
condensation in a flue gas condensing heat exchanger was
developed using MATLAB. Governing equations based on
mass and energy balances for the system were derived to
predict variables such as flue gas exit temperature, cooling
water outlet temperature, mole fraction and condensation rates
of water and sulfuric acid vapors. The equations were solved
using an iterative solution technique with calculations of heat
and mass transfer coefficients and physical properties.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...ssuser7dcef0
Power plants release a large amount of water vapor into the
atmosphere through the stack. The flue gas can be a potential
source for obtaining much needed cooling water for a power
plant. If a power plant could recover and reuse a portion of this
moisture, it could reduce its total cooling water intake
requirement. One of the most practical way to recover water
from flue gas is to use a condensing heat exchanger. The power
plant could also recover latent heat due to condensation as well
as sensible heat due to lowering the flue gas exit temperature.
Additionally, harmful acids released from the stack can be
reduced in a condensing heat exchanger by acid condensation. reduced in a condensing heat exchanger by acid condensation.
Condensation of vapors in flue gas is a complicated
phenomenon since heat and mass transfer of water vapor and
various acids simultaneously occur in the presence of noncondensable
gases such as nitrogen and oxygen. Design of a
condenser depends on the knowledge and understanding of the
heat and mass transfer processes. A computer program for
numerical simulations of water (H2O) and sulfuric acid (H2SO4)
condensation in a flue gas condensing heat exchanger was
developed using MATLAB. Governing equations based on
mass and energy balances for the system were derived to
predict variables such as flue gas exit temperature, cooling
water outlet temperature, mole fraction and condensation rates
of water and sulfuric acid vapors. The equations were solved
using an iterative solution technique with calculations of heat
and mass transfer coefficients and physical properties.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
This article is all about what AI trends will emerge in the field of creative operations in 2024. All the marketers and brand builders should be aware of these trends for their further use and save themselves some time!
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
178. > you are in a dark forest
>
> you see a light in the north
179. > you are in a dark forest
>
> you see a light in the north
>
> you have a map
180. > you are in a dark forest
>
> you see a light in the north
>
> you have a map
>
> what do you do?
181. > you are in a dark forest
>
> you see a light in the north
>
> you have a map
>
> what do you do?
>
> look at map
182. > you are in a dark forest
>
> you see a light in the north
>
> you have a map
>
> what do you do?
>
> look at map
>
> does not understand “look at map”
183. > you are in a dark forest
>
> you see a light in the north
>
> you have a map
>
> what do you do?
>
> look at map
>
> does not understand “look at map”
>
> look around
184. > you are in a dark forest
>
> you see a light in the north
>
> you have a map
>
> what do you do?
>
> look at map
>
> does not understand “look at map”
>
> look around
> you are in a deserted field. There is a sharp rock.
186. # not real code, don’t judge me
playing = true
while playing
ask “What do you want to do next?”
parse user input
perform action based on user input
if user dies or game ends
playing = false
end
end
187. def play
puts "Welcome to #{@map.title}"
puts "What would you like to do? (Enter 'help' to see
a list of commands)"
parse_choice(gets.chomp)
while @playing
break if !@playing
puts "What now?"
choice = gets.chomp
parse_choice(choice)
end
end
Ruby
188. fn main() {
let player = player::Player::new(vec![], 1, 1);
let map = map::Map::new("Great Rust Adventure",
rooms);
let mut game = game::Game::new(player, map, true);
while game.playing {
game.play();
}
}
Rust
The full title of this talk, which does not actually fit on most CFP submission forms, is “The Illustrated Adventure Survival Guide for New rustaceans and Natives of Rubyville.” with apologies to _why the lucky stiff. I don’t know how many of you are familiar with the work of _why, but if you’re not, I would strongly recommend looking him up after this. He was a Rubyist who did a lot of really interesting work that was a big reason for me getting into programming, and this entire talk is a bit of an homage to Why’s Poignant Guide to Ruby.
So, welcome! I really have to commend you, it took a lot of courage to sign up for this mission. This adventure we’re about to embark on
is not for the weak or faint of heart.
So if any of you are pregnant
or nursing,
or suffer from any kind of heart condition,
or if your doctor has advised against the eating of spicy foods,
I ask that you consider consulting your physician,
spiritual advisor, psychic medium,
or nosy next-door neighbor before accompanying me on this journey.
While we wait to board the ship, some of you might want to know a little bit about me, your guide, before moving forward with this seafaring journey, and I get it. I understand.
I don’t look quite like a seasoned ship’s captain, and you’re right!
I’m not. I’m Liz.
I used to be a cartoonist (I drew comic books),
I went to art school,
drew a few graphic novels.
A few years ago I learned to code,
went to the Flatiron School in New York and started working in web development.
Nowadays I work at Tilde in Portland, OR
Mainly I work on our product, Skylight, which is an application that helps developers working in Rails or other Ruby-based frameworks optimize their own apps.
We also use Rust, which is a big part of why I started learning Rust in the first place.
So before we get on the ship, I’ll show you a map of where we’ll be going. Right now, our ship is docked at the Port of Javascript, just off the coast of Rubyville. We’ll be sailing the seas of chunky bacon and should be landing at the Cargo Bay of Rustlandia in no time!
So let’s get on board, take your seats,
no standing,
no eating or drinking, and most importantly
no staring at the captain’s eye he’s really sensitive about it
Say goodbye to your loved ones, off we go!
If you all look out your windows to the west you’ll notice a beautiful sight, some foliage that’s native to Rubyville - an abstract syntax tree! It’s nodes are particularly lovely this time of year. You’re probably used to seeing these if you’re from Rubyville,
they tend to sprout anytime some code gets thrown into the interpreter, just before it gets turned into byte code so the Ruby Virtual Machine can run it. As you might already know, Ruby is an interpreted language, so this is more or less what you’re used to if you’re a Rubyist
but in Rustlandia we’ll have to remember to compile our code before we can run it - otherwise it won’t work! So when we get there, just remember two key phrases
cargo build
and cargo run. They’ll come in handy when we reach the shore and start trying to chat up the locals.
If you try to just run your code directly like you did in Rubyville,
they won’t know what you’re talking about.
Oh, I almost forgot to mention, on the way out you’ll notice a big pile of mains - don’t forget to take one! You’ll need to put all the code that gets run for your program inside of main (unless you’re building a library, which we’re not just yet). Very important.
Alright everybody off the ship, here we are! Welcome… to Rustlandia! Let’s check out the town! Remember, things move a lot faster here, so be careful!
Check it out, it’s the Stack and the Heap brew pub! let’s go inside. You’re probably used to not giving much thought to memory back in Rubyville.
Before I came to Rustlandia I had heard of the Stack and the Heap and I knew it had something to do with memory but never really understood it.
Watch how things work at the bar.
People come in and give their programs to the bartender, and she compiles and runs them.
Someone wants a fancy whisky and a cheap whiskey. The good stuff is fancy so we put that in a Box and store it on the heap, because we want it to be able to stick around for a while, even though it’s high up and a bit slower to get to. Most things in Rust are stored on the stack unless you specify otherwise, which is why we had to put the fancy whisky in a Box in order to store it on the heap.
So when we run this program, the good_whisky gets a spot on the heap, at the far far end of our available memory,
and we put a pointer on the stack that points to that spot on the heap. Next on the stack we put the cheap_stuff, in this case it is “Old Grand-Dad,” which is a very terrible bourbon. The cheap_stuff gets served up first because it’s on top, and then we have the pointer to the fancy stuff, which the bartender has to go way way up to the top of the heap to get, which she does.
All that sea travel made me hungry I think. Let’s check out one of the local eateries. I’ve heard good things about this one. It’s called Cafe de Struct.
“Uh sir I can’t quite read this menu… i’m used to seeing things like
this. There is a defined class, and the instance methods for that class are defined with a simple “def”, and they end with the word “end”
Instead I see all these strange new things… like, Structs and Impls and… what’s this all about, huh? WAITER!!!
So sorry madam, I know this isn’t something you’re used to back in Rubyville but … we here in Rustlandia, we um… have no class
I can’t believe it! This is terrible! How are we going to get along without class? It’s the one thing separating us from the animals!
Don’t worry, don’t worry at all - you can still get what you need!
here, here is the ChunkyBacon struct. That’s where we define all the attributes we expect out of it - flavor, chunkiness, price, etc
so then I can just do something like
this and i’ll be all set?
no no my good lady, for that you’ll need to write an Impl
that’s an Implementation of ChunkyBacon. So if you want a new instance of ChunkyBacon
you’ll have to write a new() method yourself - it doesn’t just happen automatically.
Customer - well then! Very good. I’ll have a….
i’ll have a salad
and now, a word from our sponsors
HEY MACK!
Me?
YEAH YOU THERE. YOU WANNA TRY SOME RUST?
You mean the iron oxide produced as a result of a redox reaction of iron and oxygen in the presence of water or air moisture?
WHAT HAVE YOU BEEN READING WIKIPEDIA? No NOT THAT RUST, FOOL!! RUST LANG MY FRIEND!
Oh yeah that cool new systems programming language all the kids at school are talking about?
THE VERY SAME.
well, what about it?
DO YA LIKE
abstraction without overhead?
uh I don’t know
HOW ABOUT
concurrency without data races?
I think???
WHAT ABOUT
memory safety without garbage collection?
That… *sounds* good? I really don’t…
YOU’LL LOVE RUST
Welcome to Mutability Lake! It’s a lovely day, so many of our distinguished townspeople are out sailing their toy ships. Some are fancier than others, some are mutable, some aren’t.
This one here is a nice one - this one’s not mutable, so we can’t change anything about it, but I can pick it up and show it to you! Look how nice! But if we try to change anything about it
HEY YOU CAN’T DO THAT! Ah the compiler is yelling at us… so we know we can’t change this boat. It’s immutable. Let’s try another one.
Let’s look back at what other ships are in the lake. COOL! This one’s definitely mutable. It has a little flag that says “mut.” Let’s just make a few changes before we return it.
So let’s add some wheels to this boat. PERFECT. Compiler what do you think?
What’s the matter, compiler?
YOU PUT WHEELS ON A BOAT IT’S NOT A BOAT ANYMORE IT’S A CAR
YOU SAID YOU WOULD RETURN A BOAT YOU MUST RETURN A BOAT. As is clearly illustrated here, the Boat struct does not include anything about wheels.
ok ok
I’ll take the wheels off. I thought it looked pretty cool though!
Let’s look for another boat in the lake. Hey THAT one looks pretty cool
Yoink!
HEY! THAT BOAT DOESN’T BELONG TO YOU!
Oh, sorry compiler! Who owns this boat?
i do
Oh, so sorry. Can I borrow it? I was hoping to play with it in my bathtub.
Well… will you bring it back?
Of course!
go right ahead!
don’t forget this ampersand! so everyone knows you’re just borrowing it.
So now, of course - the musical montage! (play music)
hey thanks for returning my boat. compiler, does everything look good to you?
NO YOU ADDED A TUGBOAT THAT’S NOT OK
but compiler, these boats are all Vectors of Strings, all I did was push a tugboat onto it. A tugboat is a string!
the tugboat isn’t yours and neither is the boat!
Yeah that tugboat is mine
well what if I just….
BOOM punch the tugboat guy in the face and hit him with a remove!
looks like no one owns this tugboat now
you want a tugboat on your boat sir?
sure
Let’s do boat dot push and pass in the tugboat. now you have one!
and now, a word from our sponsors.
hey kid
what?
DID YOU GET ALL THAT INFORMATION ABOUT OWNERSHIP AND BORROWING
huh?
THAT’S HOW WE GET A LOT OF THE COOL STUFF I WAS TELLING YOU ABOUT BEFORE
you mean like when you were yelling ‘memory safety without garbage collection ‘ at me?
YES YOU GOT IT
I only know Ruby though so those aren’t really problems I’ve had to deal with
WELL LET ME TELL YA IF YOU WERE A C PROGRAMMER YOU’D BE REALLY EXCITED
ok
YOU BET IT”S OK
can you just teach me something about Rust so the kids at school will finally think I’m a cool guy?
SURE THING KID WE’LL TRY A LESS CONVOLUTED METAPHOR, WATCH THIS!
Hello again, travelers! Have you seen our esteemed library? It’s pretty great. You can borrow just about anything, as long as you return it,
they even have this great big pile of books over here that don’t belong to anyone, you can just take them if you want and then they’re yours! Every so often people will come by with donations of books they don’t need anymore, it’s great!
If you want to borrow a book you just use your ampersand
If you try to change a book while you’re borrowing it -
the compiler will yell at you and your code won’t compile.
However, if you see something you like in the “free” pile, you can just take it, and do whatever you want with it - it’s yours! You there, in the back - you had a question?
yes what about if the book is a mutable reference?
Great question, friend! Well, you might very well be borrowing something that’s mutable (&mut) like our collection of coloring books here (such titles as “Color me Sartre”, “Hell is Other Colors,” and “The Colors of Ambiguity”) - you can continue coloring in them while you have them and you can return them altered. Only one person can have one out at a time though.
We also have some Exquisite Corpse books that are pretty cool - every time someone borrows one of those, they add a little bit to it themselves before bringing it back.
I want to borrow the exquisite corpse book!
me too! I want to borrow it too!
No more than one mutable reference at a time. You can have it now, but you have to wait until the first person done before you can borrow it
aw man
No complaining! Do you want a data race? DO YOU?
no…
okay then
So you might have noticed how clean and beautiful Rustlandia is, and yet you might have also noticed there are no garbage cans anywhere! It’s actually because of that system of borrowing and ownership that Rustlandia is able to do without garbage collection, it’s a big part of what makes everything so fast and safe here!
But isn’t it annoying having the compiler yelling at you all the time?
Hey now, don’t judge the compiler so harshly look you hurt his feelings!! He’s not such a bad guy, he’s just making sure everything we do is good before we can run it.
The compiler is our friend who just wants the best for us! Sure his advice might be a little hard to understand at times but once you get to know him, he’s really a good guy. I promise!
and now, another word from our sponsors
TONIGHT ON WRST IT’S THE TRUE STORY OF HOW ONE STATICALLY TYPED PROGRAMMING LANGUAGE RISKED IT ALL TO FIGURE OUT HOW TO HANDLE IT WHEN THINGS GO WRONG.
“If everything goes right, the reactor will cool down and the city will be saved. But if something goes wrong… if this whole thing goes south
None
well I guess I’ll just do nothing . I mean this seems like the time to return an Option right? I mean the compiler feels fine about it right?
meanwhile, across town
the grocery store does not have the mustard i like!
RED ALERT RED ALERT EVERYONE PAY ATTENTION SHUT EVERYTHING DOWN I NEED MY DIJON!!! COMPILER AGREES DON’T YOU COMPILER
Public Service Announcement: just because the code compiles doesn’t mean it’s something you should do.
Results - for when something could go terribly wrong and you need to throw an error. Option - for when it’s ok to just do nothing.
Hey welcome back!! Just in time for the last boat back to Rubyville. I sincerely hope you enjoyed your stay and that you visit again soon! If you want to stay a little longer there are some very nice Boxes at the Heap, otherwise the boat is ready to board!
On your way back we do have some very nice reading material for you if you’re interested in learning more about Rust:
I strongly recommend starting with Rust by Example, this online book will lead you by the hand step-by-step through many examples, explaining everything along the way
After that I recommend looking at the official Rust reference documentation, very helpful
If you’d like to try your hand at some Rust of your very own from scratch there are many excellent exercises available at exercism. There’s also an exercism table in the Expo Hall, if you’re interested in learning more about how to use exercism to learn a new programming language.
If you have questions, there is the Rust Reddit and the user forums, or you can chat on one of many channels on IRC
In preparation for the original version of this talk at RustConf last year, with some help from my boss Yehuda Katz, I developed a playable text-based adventure game in both Ruby and Rust. This way you can check out Ruby and Rust code that do similar things side-by-side. I’ve written a few really little ones over the years, usually when I’m trying to learn a new language or if I’m playing with a new idea. Some of you may never have played one, but it’s basically a game where everything is text. In my case, the whole game is played in your terminal, like it’s the 80s.
So the way it works is, you get a prompt, usually a sentence or two followed by a question, like “You are in a dark forest.
You see a light in the north
You have a map
What do you do? And then you type something like
“look at map”
then the computer responds with something else,
and you type something else
The computer responds to that, and so on and so forth, until your character dies or the game is over. I think nowadays games like this are also called “interactive fiction.” Let’s take a quick look at the actual game I wrote to give you a better idea of what I’m talking about. (go to terminal)
So that’s the game. But how did I actually build it? Before writing a single line of code, I had to think about the architecture of the game, and there were a million different ways I could find to structure it. In the end, I wanted something extremely simple, so I went with a really basic loop
that continues to ask what the player wants to do next until a particular condition is met, at which point the game ends. So in this example, which I stress is not real code, just an example of the structure I was using, we start by defining “playing” as true, and while playing is true, the game asks “What do you want to do next?” It then parses whatever the subsequent user input is and it performs an action based on that input (like, if the user says “move north” then the player’s position is changed and maybe we output something like “You have moved north”). We don’t exit the loop unless the user dies or the game ends, at which point playing is redefined as “false”. So what does this look like in Ruby or Rust?
In Ruby, there’s a lot going on before we get to the “play” method, but that’s where the loop is so that’s what I’m showing you. This is a method on the “Game” class, which is initialized with a player, a map, an array of rooms, and with the value of playing as “true” so as long as playing remains true, the game will keep asking “What now?”, then parse whatever the user types, and respond to that.
So, this example is ignoring a lot of other code that I wrote to support this, much like the Ruby example, but for the sake of simplicity here you can see we are creating a Player, a Map, and a Game, and you can see that while game dot playing, game play! Pretty close to what I illustrated earlier. What you can’t see, though is that unlike Ruby, I had to write my own “new” method, because Rust does not automatically give you anything like Ruby’s “initialize” and isn’t object-oriented by nature, the way Ruby is, so there are no classes per se. Otherwise, it seems pretty similar to the Ruby version, just a little more code, which is fine.
So what differences did I notice in writing the game? With Ruby, I felt like I could just write whatever I wanted, make something work quickly, and then reorganize the code as I went. It’s easy to have a real “flow” like you’re just writing your ideas down in your journal and making things up as you go along. The downside of this is that it’s easy to get caught up in that flow and forget to check things out as you go, forget to test, forget to run every single part of the program that you just wrote.
So I’d periodically run the program and things would just break. Without adding a whole bunch of tests after the fact, which isn’t great, I didn’t have a lot of confidence that something wouldn’t unexpectedly fall apart at runtime. All because I got caught up writing the game and forgot to check things out as I went along.
Rust, on the other hand, is kind of the reverse experience. Since Rust needs to be compiled before you run it, the compiler literally won’t let you run the program until you fix all the stuff it doesn’t like. Not coincidentally, I have NOT run into any of those pesky random bugs in the Rust version of the game,
probably because the compiler caught them before they would have become a problem. This can be super frustrating when you’re first learning Rust, because it can be oh so satisfying to just see SOMETHING working, and you could be working for hours just seeing errors like this over and over. It can easily become disheartening if you’re new to it. This example, by the way, I had to force an error because it had been so long since the Rust version of the game had any compiler errors. It’s just that good.
So the best way I can think to compare Ruby and Rust, in terms of my personal experience with the two, is they’re like two different parenting styles. This might seem like an odd comparison, but bear with me!
Ruby is like those hippie parents who let their kids do basically whatever they want and don’t put a whole lot of restrictions on them because they know the kids will figure things out on their own eventually and they’ll be ok. The downside, of course, is that the kids will hit all kinds of bumps in the road along the way because no one ever told them they should or shouldn’t do any particular thing.
Rust is like those parents who are constantly telling their kids what’s best for them. They’re a little bit strict, not that bad, but just always giving unsolicited advice based on their own experiences. And yeah, maybe it turns out their advice was right, but it’s definitely a little annoying to be hearing it all the time.
And just like parents, you can’t really say one way of doing things is better or worse than another, but they both have their pros and cons depending on what you’re trying to do and how you prefer to work. I’m sure someone with more experience could give you a more in-depth analysis, but this is my opinion based on my limited experience just writing a simple text game. So if you’re thinking of learning Rust, or Ruby, or both, I say go for it.
You can check out the game I built at https://github.com/tildeio/learning-rust. Both versions are playable but both have kind of filler stories in them. The Ruby version’s filler game is a little more fun though, if you can only play one of them.
Finally, there is another Rust talk later today called “Rust for non-Rust developers” at 5:05pm in Ballroom G which sounds really interesting. I don’t know a whole lot about it, but from the description it seems like if you want a more straightforward technical talk about why you would want to use Rust, some comparisons between Rust and Java, Python, and C, and deeper discussion about Rust’s type system as well as more information about the compiler and other fun stuff, this seems like a good talk to check out! I will probably check it out and if you’re interested in learning Rust, you should too!
Thank you for having me!
Once again, my name is Liz. I’m on Twitter at @_lbaillie and that’s it, the end