Types are becoming more important in software as programs grow larger and more complex, leading to more bugs. New types like Optional help prevent null pointer exceptions while async/await make asynchronous code more intuitive. More advanced types still being adopted include algebraic data types that model relationships between data, dependent types that allow types to depend on values, and linear types that prevent multiple uses of resources. These new types allow for stronger guarantees and more bugs caught at compile time rather than runtime.
The document discusses the Metasepi project, which aims to create a Unix-like operating system using strong typing to avoid runtime errors. It began when the author worked at Ricoh developing embedded devices based on NetBSD and observed quality issues from lack of shared specifications. The Metasepi project hypothesizes that strong types can capture specifications to prevent some runtime errors. The first iteration involved creating a Haskell compiler called jhc to use the strong typing of Haskell for the operating system code. The document debates whether the research institution RIKEN AICS should support continuing the Metasepi project.
Top 10+ Things .NET Developers Should Know About RubyJeff Cohen
?
This document outlines 11 things that every .NET developer should know about Ruby. It provides a brief history of Ruby and its philosophy of prioritizing what feels natural over what is possible. It also summarizes key Ruby concepts like IRB, conventions, objects always being objects, blocks, dynamic typing, metaprogramming, and more. The document encourages .NET developers to try Ruby and notes some differences from .NET like how classes are open and types are deduced at runtime rather than compile time.
This document discusses different Ruby implementations and how alternate implementations like JRuby can impact Ruby on Rails applications. It summarizes a story of porting a Rails app to JRuby and some of the challenges that may come up, like incompatible gem versions or argument errors. It then dives deeper into the code for ActiveSupport and TimeWithZone to understand the root cause of an argument error between implementations. It finds that the behaviors for comparison methods like <=> are not fully specified and can behave differently between Ruby interpreters like JRuby and MRI. The document advocates for communication in the Ruby community to address these types of implementation inconsistencies.
Metasepi team meeting #16: Safety on ATS language + MCUKiwamu Okabe
?
This document summarizes the key topics from meeting #16 of the Metasepi team:
1. The meeting discussed using the ATS programming language for developing Metasepi, an operating system designed with strong typing.
2. A demonstration showed running ATS code on an Arduino and mbed microcontroller platform.
3. ATS is a strongly typed language like ML that uses dependent types, linear types, and optional garbage collection to promote safe systems programming without runtime errors.
Machine vision and device integration with the Ruby programming language (2008)Jan Wedekind
?
This document provides a summary of a research seminar on machine vision and device integration using the Ruby programming language. The seminar will be held on February 29th, 2008 and will discuss projects using a transmission electron microscope, digital camera, piezo controller and nano indenter as well as a micro camera and piezo drives. It will also discuss proprietary business models versus community development models and differences between GPLv3 and BSD licenses. An introduction to the Ruby programming language is provided including statistics on usage from the Tiobe index and speed comparisons to other languages.
The document discusses various approaches for exposing instance variables from controllers to views in Ruby on Rails applications. It compares the pros and cons of using helper_method, decent_exposure, and obviews for this purpose. Examples are provided showing how to expose a post object from a PostsController to views using these different approaches. The discussion concludes by noting that the obviews gem for exposing instance variables is being released on RubyGems.
Why Rust? by Edd Barrett (codeHarbour December 2019)Alex Cachia
?
For longer than I have existed, memory errors have plagued systems programming. Although many such errors are benign, sadly many end up being security vulnerabilities, or worse, exploits. In this talk, I will discuss how a security exploit is born, and how the Rust
programming language tries to prevent them.
Aaron Patterson's talk from Future Insights Live 2014 in Las Vegas: "The Web is constantly changing, and technology is constantly evolving. With these ideas in mind, let's look at what Ruby and Rails not only can do, but must do in order to push technology forward on the web."
Miss his talk? Join us at a future show: www.futureofwebapps.com. Sign up for our newsletter at futureinsights.com and get 15% off your next conference.
Technical presentation given by Laurent Duveau at Prairie Dev Con in Winnipeg on June 07th, 2017.
Thanks to Dan Wahlin for providing the original version of the slides. I added more content to fit in a 1h talk.
Called ¡°downcase¡± on nil? Forgot to return the right object in one of your logic branches? Called ¡°first¡± on a String instead of an Array and spent half an hour trying to figure out why a single character was getting passed around everywhere?
At Grailed, these situations were not uncommon. We are the largest marketplace for luxury men's fashion, with over 7 million users, and a growing Rails codebase that spans hundreds of thousands of lines. Before typing, changes to core interfaces often required creative grepping, modification of type checking unit tests, and updating brittle type documentation.
Ever since we started gradually typing our codebase with Sorbet, we¡¯ve been able to make intrusive changes faster and confidently. In this talk, we¡¯ll walk you through our prior art, challenges, learnings, and big benefits of typing our codebase.
This document summarizes a presentation about PHPIDS, a tool that monitors websites for attack surface activity and detects bad inputs to help secure PHP applications. PHPIDS uses over 70 regular expressions to detect attacks like XSS, SQL injection and others. It analyzes, converts and normalizes inputs before matching them against rulesets. PHPIDS is lightweight, free and open source. It is used on many popular websites and has an active community of developers constantly improving it through testing.
This document discusses Domain Specific Languages (DSLs) and their use in JavaScript. It begins by defining DSLs and providing examples of domain-specific lexicons. It then covers internal and external DSLs, and examples of JavaScript DSLs like JSSpec (for testing) and ActiveRecord.js (for object-relational mapping). The document concludes by discussing lessons learned from building DSLs in JavaScript, such as its lack of namespaces being a challenge but prototypal inheritance and object literals providing opportunities.
Technical presentation given by Laurent Duveau at the House of Commons in Ottawa on April 25, 2017.
Thanks to Dan Wahlin for providing the original version of the slides. I added more content to fit in a 1h talk.
It's a talk about how to write understandable code from understanding human brain at Taipei.py [1] and PyCon HK 2015 [2].
[1]: http://www.meetup.com/Taipei-py/events/222174472/
[2]: http://2015.pycon.hk/
Overview of Groovy language features and lead to Functional Programming in Groovy. As this is a code along session backed by this presentation, code examples are not include here as I code them live.
RubyConf Portugal 2014 - Why ruby must go!Gautam Rege
?
The document discusses the Go programming language and how it differs from Ruby. It provides examples of Go code demonstrating type declarations, embedded types, exported variables and functions, and variable redeclaration. It also discusses some concepts in Go like interfaces, channels, and concurrency that are different from Ruby. The document suggests that Go teaches programmers awareness about variables, types, and errors that can improve Ruby code.
This presentation is by Doug Crockford, I'm reposting it here from this Google Blog post: http://googlecode.blogspot.com/2009/03/doug-crockford-javascript-good-parts.html
ºÝºÝߣs from my talk at AmsterdamJS 08.06, https://amsterdamjs.com
Typescript was warmly welcomed with all our developers from C++, Java and C# background. So it was only a question of time for our public JavaScript SDK to be completely rewritten in Typescript from scratch. In my talk I will focus on good and bad things that we experienced during development, and will tell how our initial thoughts played out.
- JavaScript was created in 1995 by Brandon Eich and was originally called LiveScript. It was renamed to JavaScript to capitalize on the popularity of Java, though the two languages are unrelated.
- JavaScript is an interpreted, prototype-based scripting language that is commonly used for client-side web development but can also be used for server-side applications and other programs. It has dynamic typing and supports functions as first-class objects.
- The document discusses JavaScript syntax including variables, numbers, strings, comments, control flow statements like if/else and loops, and functions. It also covers the Rhino runtime environment for running JavaScript without a browser.
This document provides an overview of the IronRuby programming language and how it allows Ruby code to run on the .NET Common Language Runtime (CLR).
Some key points covered include:
- IronRuby allows Ruby code to leverage .NET libraries and frameworks like ASP.NET and WPF.
- The Dynamic Language Runtime (DLR) plays a key role in enabling IronRuby to run Ruby code on the CLR.
- IronRuby makes it possible to embed and extend C# applications with Ruby code through features like MEF.
- This merging of Ruby and .NET opens up new possibilities for developers to choose the right language for each task and blend multiple languages together in a single application.
This is a toy compiler for the course Compiler 2016 at ACM Class, SJTU. The source language is Mx*. The target is MIPS assembly (in SPIM format).
You can refer to my presentation slides to know something about this compiler and also what I've learnt during the course.
Github: https://github.com/abcdabcd987/compiler2016
When debugging this compiler, I wrote another project LLIRInterpreter(https://github.com/abcdabcd987/LLIRInterpreter) which reads text IR and does interpretation.
The document discusses challenges in implementing a dynamic language like JavaScript on the Java Virtual Machine (JVM). Some key points:
- Nashorn is a JavaScript runtime written in Java that generates JVM bytecode, aiming to be 2-10x faster than previous solutions like Rhino.
- Compiling JavaScript to JVM bytecode is difficult as JavaScript has dynamic types, runtime changes, and number representations that don't map cleanly to Java's static types.
- Nashorn uses static analysis to infer types where possible and optimize for primitive number representations, but this only goes so far with JavaScript's dynamic nature.
- As JavaScript code changes, Nashorn may need to transition to more dynamic, adaptive and optimistic techniques
Complete Notes on Angular 2 and TypeScriptEPAM Systems
?
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static typing, classes, and interfaces to JavaScript to help catch errors. TypeScript code is converted to JavaScript code during compilation. Angular 2.0 is written in TypeScript to take advantage of its static typing and other features. TypeScript allows programmers to write object-oriented programs and have them compiled to JavaScript, enabling both server-side and client-side development.
Under the hood of architecture interviews at indeedFangda Wang
?
Architecture or System Design Interviews are a common way for Software Companies to evaluate candidates and are open ended enough to have volumes written about them. This talk will try to address expectations from interviewers and candidates for this interview type and Bharat's account for how Indeed manages them.
Aaron Patterson's talk from Future Insights Live 2014 in Las Vegas: "The Web is constantly changing, and technology is constantly evolving. With these ideas in mind, let's look at what Ruby and Rails not only can do, but must do in order to push technology forward on the web."
Miss his talk? Join us at a future show: www.futureofwebapps.com. Sign up for our newsletter at futureinsights.com and get 15% off your next conference.
Technical presentation given by Laurent Duveau at Prairie Dev Con in Winnipeg on June 07th, 2017.
Thanks to Dan Wahlin for providing the original version of the slides. I added more content to fit in a 1h talk.
Called ¡°downcase¡± on nil? Forgot to return the right object in one of your logic branches? Called ¡°first¡± on a String instead of an Array and spent half an hour trying to figure out why a single character was getting passed around everywhere?
At Grailed, these situations were not uncommon. We are the largest marketplace for luxury men's fashion, with over 7 million users, and a growing Rails codebase that spans hundreds of thousands of lines. Before typing, changes to core interfaces often required creative grepping, modification of type checking unit tests, and updating brittle type documentation.
Ever since we started gradually typing our codebase with Sorbet, we¡¯ve been able to make intrusive changes faster and confidently. In this talk, we¡¯ll walk you through our prior art, challenges, learnings, and big benefits of typing our codebase.
This document summarizes a presentation about PHPIDS, a tool that monitors websites for attack surface activity and detects bad inputs to help secure PHP applications. PHPIDS uses over 70 regular expressions to detect attacks like XSS, SQL injection and others. It analyzes, converts and normalizes inputs before matching them against rulesets. PHPIDS is lightweight, free and open source. It is used on many popular websites and has an active community of developers constantly improving it through testing.
This document discusses Domain Specific Languages (DSLs) and their use in JavaScript. It begins by defining DSLs and providing examples of domain-specific lexicons. It then covers internal and external DSLs, and examples of JavaScript DSLs like JSSpec (for testing) and ActiveRecord.js (for object-relational mapping). The document concludes by discussing lessons learned from building DSLs in JavaScript, such as its lack of namespaces being a challenge but prototypal inheritance and object literals providing opportunities.
Technical presentation given by Laurent Duveau at the House of Commons in Ottawa on April 25, 2017.
Thanks to Dan Wahlin for providing the original version of the slides. I added more content to fit in a 1h talk.
It's a talk about how to write understandable code from understanding human brain at Taipei.py [1] and PyCon HK 2015 [2].
[1]: http://www.meetup.com/Taipei-py/events/222174472/
[2]: http://2015.pycon.hk/
Overview of Groovy language features and lead to Functional Programming in Groovy. As this is a code along session backed by this presentation, code examples are not include here as I code them live.
RubyConf Portugal 2014 - Why ruby must go!Gautam Rege
?
The document discusses the Go programming language and how it differs from Ruby. It provides examples of Go code demonstrating type declarations, embedded types, exported variables and functions, and variable redeclaration. It also discusses some concepts in Go like interfaces, channels, and concurrency that are different from Ruby. The document suggests that Go teaches programmers awareness about variables, types, and errors that can improve Ruby code.
This presentation is by Doug Crockford, I'm reposting it here from this Google Blog post: http://googlecode.blogspot.com/2009/03/doug-crockford-javascript-good-parts.html
ºÝºÝߣs from my talk at AmsterdamJS 08.06, https://amsterdamjs.com
Typescript was warmly welcomed with all our developers from C++, Java and C# background. So it was only a question of time for our public JavaScript SDK to be completely rewritten in Typescript from scratch. In my talk I will focus on good and bad things that we experienced during development, and will tell how our initial thoughts played out.
- JavaScript was created in 1995 by Brandon Eich and was originally called LiveScript. It was renamed to JavaScript to capitalize on the popularity of Java, though the two languages are unrelated.
- JavaScript is an interpreted, prototype-based scripting language that is commonly used for client-side web development but can also be used for server-side applications and other programs. It has dynamic typing and supports functions as first-class objects.
- The document discusses JavaScript syntax including variables, numbers, strings, comments, control flow statements like if/else and loops, and functions. It also covers the Rhino runtime environment for running JavaScript without a browser.
This document provides an overview of the IronRuby programming language and how it allows Ruby code to run on the .NET Common Language Runtime (CLR).
Some key points covered include:
- IronRuby allows Ruby code to leverage .NET libraries and frameworks like ASP.NET and WPF.
- The Dynamic Language Runtime (DLR) plays a key role in enabling IronRuby to run Ruby code on the CLR.
- IronRuby makes it possible to embed and extend C# applications with Ruby code through features like MEF.
- This merging of Ruby and .NET opens up new possibilities for developers to choose the right language for each task and blend multiple languages together in a single application.
This is a toy compiler for the course Compiler 2016 at ACM Class, SJTU. The source language is Mx*. The target is MIPS assembly (in SPIM format).
You can refer to my presentation slides to know something about this compiler and also what I've learnt during the course.
Github: https://github.com/abcdabcd987/compiler2016
When debugging this compiler, I wrote another project LLIRInterpreter(https://github.com/abcdabcd987/LLIRInterpreter) which reads text IR and does interpretation.
The document discusses challenges in implementing a dynamic language like JavaScript on the Java Virtual Machine (JVM). Some key points:
- Nashorn is a JavaScript runtime written in Java that generates JVM bytecode, aiming to be 2-10x faster than previous solutions like Rhino.
- Compiling JavaScript to JVM bytecode is difficult as JavaScript has dynamic types, runtime changes, and number representations that don't map cleanly to Java's static types.
- Nashorn uses static analysis to infer types where possible and optimize for primitive number representations, but this only goes so far with JavaScript's dynamic nature.
- As JavaScript code changes, Nashorn may need to transition to more dynamic, adaptive and optimistic techniques
Complete Notes on Angular 2 and TypeScriptEPAM Systems
?
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static typing, classes, and interfaces to JavaScript to help catch errors. TypeScript code is converted to JavaScript code during compilation. Angular 2.0 is written in TypeScript to take advantage of its static typing and other features. TypeScript allows programmers to write object-oriented programs and have them compiled to JavaScript, enabling both server-side and client-side development.
Under the hood of architecture interviews at indeedFangda Wang
?
Architecture or System Design Interviews are a common way for Software Companies to evaluate candidates and are open ended enough to have volumes written about them. This talk will try to address expectations from interviewers and candidates for this interview type and Bharat's account for how Indeed manages them.
How Indeed asks coding interview questionsFangda Wang
?
Coding interviews (aka. whiteboard interviews, or programming interviews) are the primary tools used by Indeed and major tech companies (e.g. Google, Amazon, Facebook) to measure technical skills for potential employees. There are a lot of articles and talks to help interviewees prepare and perform well on the coding interview. However, not many of them share insight into how employers conduct coding interviews and their challenges.
This talk is mainly for companies/managers who want to improve their hiring, or persons who are inspired to be a good interviewers. Wanasit will share his insight on how Indeed (and other tech companies) designed their interviewing processes and trains interviewers, including their principles and challenges.
For the interviewees or students, this talk helps you understand the interviewer-side perspective, thus, helps you prepare for the next interviews. It also includes a few uncommon interviewing tips at the end.
In this talk, Tatiana will take you on a journey from IC to Tech Lead. She had a lot of struggles and unknowns along the way for years, but she decided to share those experiences as well as the efficient way to go about the role. She will give actionable ideas and provide a reference point on how Tech Leading could look like in practice.
In this talk, Wanasit will share what he learn about Japanese NLP after trying to build a Japanese tokenizer from scratch.
Doing Natural Language Processing (NLP) or text processing for Japanese has many challenges. One of the most basic and obvious problems is tokenization (aka. splitting text into a list of words).
Unlike English that the words typically separated by space, splitting Japanese text (e.g. ÈÕ±¾ÕZ¤Î×ÔÈ»ÑÔÕZ„IÀí¤òÐФ¦¤Ë¤Ï¡) doesn¡¯t have such a rule-of-thumb. It requires the tokenizers and NLP tools to be a lot more sophisticated.
Nowadays, with so many programming languages in existence, it can be very difficult to choose one that's fit for you. However, as many of them are adopting functional programming (FP) concepts, this common ground can help you to pick up any of them. During this talk you will learn about general FP principles on the example of one of the most extensively developed modern languages - Scala - and see how these principles allow you to write better software.
The document discusses the pros and cons of pair programming versus solo programming. Pair programming may lead to faster problem solving, easier ramping up for new developers, and happier working hours. However, it could also result in mismatched work strategies between pairs or the establishment of full-time teacher/student roles. The document argues that pair programming is most effective when the right habits are learned, there is respect between partners, problems are solved quickly, and tasks are appropriately challenging.
This document discusses balanced teams and a demo of Pivotal practices. It begins with an overview of balanced teams, which bring together product managers, designers, and developers on the same team. The document then introduces the presenters and provides an agenda for their demo. It describes the history and benefits of balanced teams, including flexibility, shared understanding, shared product ownership, and avoiding bottlenecks. The remainder gives resources for learning more and outlines the live demo, which will create a Spring Boot app integrated with a MySQL database and deploy it to Pivotal Cloud Foundry.
Functional programming originated from lambda calculus developed in the 1930s. Functional programming uses mathematical functions and avoids side effects. Elm is a pure functional language for building web applications that compiles to JavaScript. Elm enforces semantic consistency through its type system and avoids runtime exceptions. The Elm architecture defines a simple pattern for building web apps with a model, view, and update function. Elm helps demystify functional programming concepts and provides helpful error messages.
Luca Mugnaini discusses using Elm at large companies like Rakuten. He outlines several ideas and solutions for implementing Elm, including creating static pages, developing style frameworks, building widgets, testing scenarios, enhancing HTTP requests, and facilitating multilanguage applications. The goal is to establish a team of around 10 Elm developers within a year through training and examples.
This document discusses best practices for developing data science products at Philip Morris International (PMI). It covers:
- PMI's data science team of over 40 people across four hubs working on fraud prevention and other problems.
- Key principles for PMI's data science work, including being business-driven, investing in people, self-organizing, iterating to improve, and co-creating solutions.
- Challenges in data product development involving integrating work between data scientists and other teams, and practices like continuous integration/delivery to overcome these challenges.
- The role of data scientists in contributing code that is readable, testable, reusable, reproducible, and usable by other teams to integrate into
Lessons learned when managing MySQL in the CloudIgor Donchovski
?
Managing MySQL in the cloud introduces a new set of challenges compared to traditional on-premises setups, from ensuring optimal performance to handling unexpected outages. In this article, we delve into covering topics such as performance tuning, cost-effective scalability, and maintaining high availability. We also explore the importance of monitoring, automation, and best practices for disaster recovery to minimize downtime.
¦Ñ. ¦ª?¦Ò¦Ó¦Á? ¦²¦Á¦Ö¦Ð?¦Æ¦Ç?: Foundation Analysis and Design: Single Piles
Welcome to this comprehensive presentation on "Foundation Analysis and Design," focusing on Single Piles¡ªStatic Capacity, Lateral Loads, and Pile/Pole Buckling. This presentation will explore the fundamental concepts, equations, and practical considerations for designing and analyzing pile foundations.
We'll examine different pile types, their characteristics, load transfer mechanisms, and the complex interactions between piles and surrounding soil. Throughout this presentation, we'll highlight key equations and methodologies for calculating pile capacities under various conditions.
How to Build a Maze Solving Robot Using ArduinoCircuitDigest
?
Learn how to make an Arduino-powered robot that can navigate mazes on its own using IR sensors and "Hand on the wall" algorithm.
This step-by-step guide will show you how to build your own maze-solving robot using Arduino UNO, three IR sensors, and basic components that you can easily find in your local electronics shop.
Air pollution is contamination of the indoor or outdoor environment by any ch...dhanashree78
?
Air pollution is contamination of the indoor or outdoor environment by any chemical, physical or biological agent that modifies the natural characteristics of the atmosphere.
Household combustion devices, motor vehicles, industrial facilities and forest fires are common sources of air pollution. Pollutants of major public health concern include particulate matter, carbon monoxide, ozone, nitrogen dioxide and sulfur dioxide. Outdoor and indoor air pollution cause respiratory and other diseases and are important sources of morbidity and mortality.
WHO data show that almost all of the global population (99%) breathe air that exceeds WHO guideline limits and contains high levels of pollutants, with low- and middle-income countries suffering from the highest exposures.
Air quality is closely linked to the earth¡¯s climate and ecosystems globally. Many of the drivers of air pollution (i.e. combustion of fossil fuels) are also sources of greenhouse gas emissions. Policies to reduce air pollution, therefore, offer a win-win strategy for both climate and health, lowering the burden of disease attributable to air pollution, as well as contributing to the near- and long-term mitigation of climate change.
Gauges are a Pump's Best Friend - Troubleshooting and Operations - v.07Brian Gongol
?
No reputable doctor would try to conduct a basic physical exam without the help of a stethoscope. That's because the stethoscope is the best tool for gaining a basic "look" inside the key systems of the human body. Gauges perform a similar function for pumping systems, allowing technicians to "see" inside the pump without having to break anything open. Knowing what to do with the information gained takes practice and systemic thinking. This is a primer in how to do that.
Welcome to the March 2025 issue of WIPAC Monthly the magazine brought to you by the LinkedIn Group WIPAC Monthly.
In this month's edition, on top of the month's news from the water industry we cover subjects from the intelligent use of wastewater networks, the use of machine learning in water quality as well as how, we as an industry, need to develop the skills base in developing areas such as Machine Learning and Artificial Intelligence.
Enjoy the latest edition
12. AdvancedTypes
FunctionTypes
number => string :Takesinanintandreturnsastring
const f: ((n: number) => string) = function (n) {
// Do something with n.
:
return "foo";
}
Generics(Java,C#,TypeScript,etc)
function firstElement<T>(arr: T[]): T {
return arr[0];
}
16. Example(Swift):
let num: Optional<Int> = function_that_may_return_nil()
if let a = num { // Take the Int inside Optional<Int>.
print(a)
} else {
print("Was nil")
}
30. UseCases
TypeScriptExample
interface Square {
kind: "square";
size: number;
}
interface Rectangle {
kind: "rectangle";
width: number;
height: number;
}
type Shape = Square | Rectangle; // Either a Square or a Rectangle.
31. TypeScriptExample(cont'd)
function non_exhaustive(s: Shape) {
switch (s.kind) {
case "square":
return s.size * s.size;
default:
const _tmp: never = s
// ^^^^ This is a compile time error!
}
return 0;
}
function not_in_part_of_the_type(s: Shape) {
switch (s.kind) {
case "square": return s.size * s.size;
case "rectangle": return s.height * s.width;
case "circle": return s.height;
// ^^^^^^^^ This is a compile time error!
}
}
49. UseCases#1
Linearresources
Files,networksockets,etc.
// Again made-up syntax. Does not actually work.
linearfunc readFile(filepath: string): string {
const fileHandle = open(filepath);
const content = readFile(fileHandle);
return content;
// Oops! Forgot to close `fileHandle`!
// Compiler can automatically emit, operation to close the handle.
}
50. UseCase#2
Performance
Ifyouknowitwon'tbeused,youcanoptimizeit.
// Again made-up syntax. TypeScript does not have this!
linearfunc f(str: string): string {
const str2 = str + "aaaaaa"; // Plain TypeScript will allocate a new memory for this.
return str2; // <- The compiler can make a decision and overwrite str in memory for performance!
}