The document discusses using the ATS programming language for low-level programming as an alternative to C. It describes c2ats, a tool that can generate ATS interfaces from C code. This allows C libraries to be accessed from ATS. The document provides examples of how c2ats translates C primitive types, functions, structures, and pointers to equivalent ATS definitions. This allows existing C code to be integrated with ATS for improved type safety and compile-time error checking compared to C alone.
The document discusses updates to the ATS2 programming language after November 2015, including using SMT solvers like Z3 to type check ATS2 programs. Specifically, the patsolve_smt2 command can convert ATS2 constraints to SMT-LIB format understood by solvers. This allows them to handle constraints over real numbers and potentially type check programs more effectively. Examples are provided for setting up ATS-extsolve and running an ATS2 Fibonacci number program through the Z3 SMT solver.
Static typing and proof in ATS languageKiwamu Okabe
This document discusses implementing a rock-paper-scissors game in C language. It first defines an enum type for the three options - rock, paper, scissors. It then shows functions to print the name of a selected option, and to determine the winning option and even option based on two input options. However, it notes that the implementation allows for potential run-time errors if the logic in the functions is incorrect.
Embedded application designed by ATS languageKiwamu Okabe
The document discusses using the ATS programming language for embedded applications. It notes that ATS features dependent types, linear types, and optional garbage collection, which could prevent bugs like Heartbleed. The document demonstrates ATS applications running on ESP8266 and Arduino hardware and notes the type of errors ATS is able to capture during compilation. It outlines an agenda to cover ATS language basics, proofs, linear types, comparisons to other languages, and conclusions.
The document discusses using the ATS programming language as a safer alternative to C for systems programming. ATS incorporates types like dependent types and linear types that can prevent bugs like Heartbleed. The document provides instructions for installing the ATS compiler on Debian Linux and shows an example FizzBuzz program in both C and ATS.
Functional languages like Scala can reduce the complexity of writing high-concurrency, high-throughput systems, but growing software with TDD in Scala presents challenges unfamiliar to those of us who spend most of our time in the JavaScript, Java, and .NET worlds.
In this session at Agile2014, Tim Myer explained how to avoid the pitfalls of testing a functional language and offered some new techniques that you can apply to development in other languages, even if you have never written software using Scala before.
The document discusses using the ATS functional programming language to develop safer IoT applications for the ESP8266 WiFi module. ATS supports dependent types, linear types, and optional memory management features that could help prevent common issues like memory safety bugs. The document outlines a demo project implementing JSON output on the ESP8266 using ATS and points out how the type system helps catch errors related to freeing memory correctly. It also advertises an upcoming meetup to discuss functional IoT development further.
C# 4.0 introduced several new language features including dynamic typing using the dynamic keyword, optional and named parameters, covariance and contravariance in generics, and improved COM interoperability. The presentation provided an overview of these features and their benefits, demonstrated examples, and discussed how the Dynamic Language Runtime enables dynamic typing in C#.
The document discusses updates to the ATS2 programming language after November 2015, including using SMT solvers like Z3 to type check ATS2 programs. Specifically, the patsolve_smt2 command can convert ATS2 constraints to SMT-LIB format understood by solvers. This allows them to handle constraints over real numbers and potentially type check programs more effectively. Examples are provided for setting up ATS-extsolve and running an ATS2 Fibonacci number program through the Z3 SMT solver.
Static typing and proof in ATS languageKiwamu Okabe
This document discusses implementing a rock-paper-scissors game in C language. It first defines an enum type for the three options - rock, paper, scissors. It then shows functions to print the name of a selected option, and to determine the winning option and even option based on two input options. However, it notes that the implementation allows for potential run-time errors if the logic in the functions is incorrect.
Embedded application designed by ATS languageKiwamu Okabe
The document discusses using the ATS programming language for embedded applications. It notes that ATS features dependent types, linear types, and optional garbage collection, which could prevent bugs like Heartbleed. The document demonstrates ATS applications running on ESP8266 and Arduino hardware and notes the type of errors ATS is able to capture during compilation. It outlines an agenda to cover ATS language basics, proofs, linear types, comparisons to other languages, and conclusions.
The document discusses using the ATS programming language as a safer alternative to C for systems programming. ATS incorporates types like dependent types and linear types that can prevent bugs like Heartbleed. The document provides instructions for installing the ATS compiler on Debian Linux and shows an example FizzBuzz program in both C and ATS.
Functional languages like Scala can reduce the complexity of writing high-concurrency, high-throughput systems, but growing software with TDD in Scala presents challenges unfamiliar to those of us who spend most of our time in the JavaScript, Java, and .NET worlds.
In this session at Agile2014, Tim Myer explained how to avoid the pitfalls of testing a functional language and offered some new techniques that you can apply to development in other languages, even if you have never written software using Scala before.
The document discusses using the ATS functional programming language to develop safer IoT applications for the ESP8266 WiFi module. ATS supports dependent types, linear types, and optional memory management features that could help prevent common issues like memory safety bugs. The document outlines a demo project implementing JSON output on the ESP8266 using ATS and points out how the type system helps catch errors related to freeing memory correctly. It also advertises an upcoming meetup to discuss functional IoT development further.
C# 4.0 introduced several new language features including dynamic typing using the dynamic keyword, optional and named parameters, covariance and contravariance in generics, and improved COM interoperability. The presentation provided an overview of these features and their benefits, demonstrated examples, and discussed how the Dynamic Language Runtime enables dynamic typing in C#.
Functional IoT: Programming Language and OSKiwamu Okabe
The document discusses functional programming languages for IoT applications. It describes ATS, a functional language without garbage collection that is compiled to C and supports theorem proving to safely use pointers. ATS has been used to program ESP8266 and Arduino devices. The document provides examples of errors that ATS can catch, like a variable needing to be freed or an unsolved constraint.
Ajhc Haskell Compiler with Reentrant GCKiwamu Okabe
The document discusses Ajhc, a Haskell compiler with reentrant garbage collection. Ajhc is based on the jhc Haskell compiler, which produces low-memory footprint binaries that run fast. The document outlines an agenda to demonstrate a NetBSD driver written in Haskell, discuss Metasepi and its goal of building a type-safe operating system, explain Ajhc and its reentrant GC features, and how to write Haskell drivers for kernels. It advocates for using safer programming languages like Haskell in core systems code to prevent bugs.
Poster: Comparing ATS and VeriFast on RTOS system stateKiwamu Okabe
The document discusses using the ATS programming language to model and verify the system state in ChibiOS/RT, a real-time operating system. ATS is able to represent the state machine of the ChibiOS/RT system state using dependent types. This allows errors from calling system APIs in the wrong system state to be caught at compile time rather than causing undefined runtime behavior. The document provides examples of ChibiOS/RT system API classifications and restrictions on their valid call states. It links to an ATS library that implements modeling of the ChibiOS/RT system state using ATS types.
The document provides instructions for installing the ATS2 programming language compiler on Debian Linux. It includes downloading the source code for ATS2 and its dependencies, installing prerequisite packages, compiling the compiler, and confirming installation is complete by checking the compiler version. The goal is for readers to learn to install ATS2 themselves by following the provided steps.
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.
The document introduces Functional IoT, which aims to create an exhaustive catalog of methodologies for strongly typed functional programming languages that can be used for embedded systems and IoT device programming. It discusses that while C/C++ are commonly used for IoT, they lack abilities like avoiding vulnerabilities, having formally verifiable specifications, and maintaining quality; and that Functional IoT will evaluate languages based on demo code running on microcontrollers to determine which languages are best suited. The goal is to determine methodologies that can help address issues like vulnerabilities, specifications, quality and efficiency.
Does Infer dream of design by contract?Kiwamu Okabe
Infer is a static analysis tool that analyzes source code to detect potential bugs such as null pointer dereferences, memory leaks, and resource leaks. It has its own model and checks code based on separation logic. Infer can analyze single files or entire projects made with Make. When run, it will output any issues found like null pointer dereferences along with the line number and a description. The document discusses how Infer could be used to implement design by contract at compile-time by adding assertions that would cause compile errors if violated.
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.
The document discusses implementing a mini programming language from scratch by first defining the grammar using ANTLR and then implementing that grammar to handle logical expressions, switch/case expressions, and comparisons for use in conversational agents. It provides examples of the types of expressions that could be supported and walks through defining tokens, rules, and grammars for WHEN and logical expressions.
This document discusses programming the ESP8266 microcontroller using the ATS programming language. It provides information on the ESP8266 module, the ATS language which features dependent types and linear types, and demonstrates examples of ATS interfaces and applications for GPIO control and blinking an LED. Code examples are referenced from a GitHub repository. The document also mentions an upcoming functional IoT meetup in December to discuss this topic further.
The document discusses the ATS programming language. ATS is presented as a safer alternative to C for systems programming due to its use of dependent types, linear types, and optional garbage collection. It can be compiled to run without a runtime on baremetal systems like an Arduino. The author is looking to spread awareness and use of ATS in Japan by starting a user group and showcasing its use for functional IoT programming.
Programming in HTML5 with JavaScript and CSS3Ali Fallahi
The document discusses JavaScript programming basics including variables, data types, operators, and strings. It introduces variable declaration and assignment, binary and unary operators, the string and Boolean data types, string concatenation, logical operators, and short-circuiting operators. Examples are provided to demonstrate JavaScript syntax and fundamentals.
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.
Software Engineering Thailand: Programming with ScalaBrian Topping
Meet-up, May 28, 2015, Launchpad, Bangkok. http://www.meetup.com/Software-Engineering-Thailand/events/222548484/.
Apologies for the rendering quality not matching the presentation, I did these with Apple Keynote and Slideshare does not support this format. I will try to edit them when there is more time.
Thanks to Bangkok LaunchPad (https://www.facebook.com/launchpadhq) for generously hosting this event!
This document discusses modifying the parser for the VeriFast verifier to better support verifying C code. VeriFast currently uses a Camlp4 parser that is a subset of C99, which can cause issues when verifying real C code that uses aspects beyond this subset. The document proposes patching VeriFast's parser to add support for parsing semicolons without declarations, hard tabs in string literals, the inline keyword, and operators in macros. The goal is to use the modified parser to verify code from the NetBSD kernel as a test case.
The Perl API for the Mortally Terrified (beta)Mike Friedman
A brief introduction to get you started in working with Perl's internal API. This presentation is a work in progress.
Code samples: http://github.com/friedo/perl-api-terror
Jay Phillips's Presentation at eComm 2009eCommConf
The document introduces Adhearsion, an open-source telephony software framework built using Ruby that allows developers to easily create voice applications and integrate telephony functionality. It discusses trends in programming languages and technologies that Adhearsion follows, such as being open-source, supporting various telephony systems, and enabling polyglot programming. Examples of what Adhearsion is and is not are provided, and the document advertises an upcoming tutorial on building voice applications with Adhearsion.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
More Related Content
Similar to Poster: Generate ATS interface from C code, and introduce linear type
Functional IoT: Programming Language and OSKiwamu Okabe
The document discusses functional programming languages for IoT applications. It describes ATS, a functional language without garbage collection that is compiled to C and supports theorem proving to safely use pointers. ATS has been used to program ESP8266 and Arduino devices. The document provides examples of errors that ATS can catch, like a variable needing to be freed or an unsolved constraint.
Ajhc Haskell Compiler with Reentrant GCKiwamu Okabe
The document discusses Ajhc, a Haskell compiler with reentrant garbage collection. Ajhc is based on the jhc Haskell compiler, which produces low-memory footprint binaries that run fast. The document outlines an agenda to demonstrate a NetBSD driver written in Haskell, discuss Metasepi and its goal of building a type-safe operating system, explain Ajhc and its reentrant GC features, and how to write Haskell drivers for kernels. It advocates for using safer programming languages like Haskell in core systems code to prevent bugs.
Poster: Comparing ATS and VeriFast on RTOS system stateKiwamu Okabe
The document discusses using the ATS programming language to model and verify the system state in ChibiOS/RT, a real-time operating system. ATS is able to represent the state machine of the ChibiOS/RT system state using dependent types. This allows errors from calling system APIs in the wrong system state to be caught at compile time rather than causing undefined runtime behavior. The document provides examples of ChibiOS/RT system API classifications and restrictions on their valid call states. It links to an ATS library that implements modeling of the ChibiOS/RT system state using ATS types.
The document provides instructions for installing the ATS2 programming language compiler on Debian Linux. It includes downloading the source code for ATS2 and its dependencies, installing prerequisite packages, compiling the compiler, and confirming installation is complete by checking the compiler version. The goal is for readers to learn to install ATS2 themselves by following the provided steps.
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.
The document introduces Functional IoT, which aims to create an exhaustive catalog of methodologies for strongly typed functional programming languages that can be used for embedded systems and IoT device programming. It discusses that while C/C++ are commonly used for IoT, they lack abilities like avoiding vulnerabilities, having formally verifiable specifications, and maintaining quality; and that Functional IoT will evaluate languages based on demo code running on microcontrollers to determine which languages are best suited. The goal is to determine methodologies that can help address issues like vulnerabilities, specifications, quality and efficiency.
Does Infer dream of design by contract?Kiwamu Okabe
Infer is a static analysis tool that analyzes source code to detect potential bugs such as null pointer dereferences, memory leaks, and resource leaks. It has its own model and checks code based on separation logic. Infer can analyze single files or entire projects made with Make. When run, it will output any issues found like null pointer dereferences along with the line number and a description. The document discusses how Infer could be used to implement design by contract at compile-time by adding assertions that would cause compile errors if violated.
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.
The document discusses implementing a mini programming language from scratch by first defining the grammar using ANTLR and then implementing that grammar to handle logical expressions, switch/case expressions, and comparisons for use in conversational agents. It provides examples of the types of expressions that could be supported and walks through defining tokens, rules, and grammars for WHEN and logical expressions.
This document discusses programming the ESP8266 microcontroller using the ATS programming language. It provides information on the ESP8266 module, the ATS language which features dependent types and linear types, and demonstrates examples of ATS interfaces and applications for GPIO control and blinking an LED. Code examples are referenced from a GitHub repository. The document also mentions an upcoming functional IoT meetup in December to discuss this topic further.
The document discusses the ATS programming language. ATS is presented as a safer alternative to C for systems programming due to its use of dependent types, linear types, and optional garbage collection. It can be compiled to run without a runtime on baremetal systems like an Arduino. The author is looking to spread awareness and use of ATS in Japan by starting a user group and showcasing its use for functional IoT programming.
Programming in HTML5 with JavaScript and CSS3Ali Fallahi
The document discusses JavaScript programming basics including variables, data types, operators, and strings. It introduces variable declaration and assignment, binary and unary operators, the string and Boolean data types, string concatenation, logical operators, and short-circuiting operators. Examples are provided to demonstrate JavaScript syntax and fundamentals.
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.
Software Engineering Thailand: Programming with ScalaBrian Topping
Meet-up, May 28, 2015, Launchpad, Bangkok. http://www.meetup.com/Software-Engineering-Thailand/events/222548484/.
Apologies for the rendering quality not matching the presentation, I did these with Apple Keynote and Slideshare does not support this format. I will try to edit them when there is more time.
Thanks to Bangkok LaunchPad (https://www.facebook.com/launchpadhq) for generously hosting this event!
This document discusses modifying the parser for the VeriFast verifier to better support verifying C code. VeriFast currently uses a Camlp4 parser that is a subset of C99, which can cause issues when verifying real C code that uses aspects beyond this subset. The document proposes patching VeriFast's parser to add support for parsing semicolons without declarations, hard tabs in string literals, the inline keyword, and operators in macros. The goal is to use the modified parser to verify code from the NetBSD kernel as a test case.
The Perl API for the Mortally Terrified (beta)Mike Friedman
A brief introduction to get you started in working with Perl's internal API. This presentation is a work in progress.
Code samples: http://github.com/friedo/perl-api-terror
Jay Phillips's Presentation at eComm 2009eCommConf
The document introduces Adhearsion, an open-source telephony software framework built using Ruby that allows developers to easily create voice applications and integrate telephony functionality. It discusses trends in programming languages and technologies that Adhearsion follows, such as being open-source, supporting various telephony systems, and enabling polyglot programming. Examples of what Adhearsion is and is not are provided, and the document advertises an upcoming tutorial on building voice applications with Adhearsion.
Similar to Poster: Generate ATS interface from C code, and introduce linear type (20)
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Poster: Generate ATS interface from C code, and introduce linear type
1. Generate ATS interface from C code,
and introduce linear type
Generate ATS interface from C code,
and introduce linear type
Generate ATS interface from C code,
and introduce linear type
Generate ATS interface from C code,
and introduce linear type
Generate ATS interface from C code,
and introduce linear type
Kiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICS
2. Today's low level programmingToday's low level programmingToday's low level programmingToday's low level programmingToday's low level programming
☆ uses C programming language.☆ uses C programming language.☆ uses C programming language.☆ uses C programming language.☆ uses C programming language.
☆ may causes buffer overflow.☆ may causes buffer overflow.☆ may causes buffer overflow.☆ may causes buffer overflow.☆ may causes buffer overflow.
☆ may violate invariant in the code.☆ may violate invariant in the code.☆ may violate invariant in the code.☆ may violate invariant in the code.☆ may violate invariant in the code.
☆ may violate specification of the design.☆ may violate specification of the design.☆ may violate specification of the design.☆ may violate specification of the design.☆ may violate specification of the design.
☆ These errors occur at run-time.☆ These errors occur at run-time.☆ These errors occur at run-time.☆ These errors occur at run-time.☆ These errors occur at run-time.
3. Why need the other language?Why need the other language?Why need the other language?Why need the other language?Why need the other language?
☆ We want to find these errors at compile-time.☆ We want to find these errors at compile-time.☆ We want to find these errors at compile-time.☆ We want to find these errors at compile-time.☆ We want to find these errors at compile-time.
☆ Of course, we can use verification on C language.☆ Of course, we can use verification on C language.☆ Of course, we can use verification on C language.☆ Of course, we can use verification on C language.☆ Of course, we can use verification on C language.
☆ e.g. Coverity, Frama-C, Infer, VeriFast, vcc, etc...☆ e.g. Coverity, Frama-C, Infer, VeriFast, vcc, etc...☆ e.g. Coverity, Frama-C, Infer, VeriFast, vcc, etc...☆ e.g. Coverity, Frama-C, Infer, VeriFast, vcc, etc...☆ e.g. Coverity, Frama-C, Infer, VeriFast, vcc, etc...
☆ But also we want to use more rich type system.☆ But also we want to use more rich type system.☆ But also we want to use more rich type system.☆ But also we want to use more rich type system.☆ But also we want to use more rich type system.
☆ Today is the day to choose the other language
for low level programming?
☆ Today is the day to choose the other language
for low level programming?
☆ Today is the day to choose the other language
for low level programming?
☆ Today is the day to choose the other language
for low level programming?
☆ Today is the day to choose the other language
for low level programming?
4. ATS languageATS languageATS languageATS languageATS language
☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/
☆ Syntax like ML☆ Syntax like ML☆ Syntax like ML☆ Syntax like ML☆ Syntax like ML
☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types
☆ Linear types☆ Linear types☆ Linear types☆ Linear types☆ Linear types
☆ Optional GC, malloc/free, run-time☆ Optional GC, malloc/free, run-time☆ Optional GC, malloc/free, run-time☆ Optional GC, malloc/free, run-time☆ Optional GC, malloc/free, run-time
5. Real of ATS programmingReal of ATS programmingReal of ATS programmingReal of ATS programmingReal of ATS programming
But, there is no paradise. Real ATS programming
needs many interfaces imported from C.
But, there is no paradise. Real ATS programming
needs many interfaces imported from C.
But, there is no paradise. Real ATS programming
needs many interfaces imported from C.
But, there is no paradise. Real ATS programming
needs many interfaces imported from C.
But, there is no paradise. Real ATS programming
needs many interfaces imported from C.
6. A tool "c2ats" resolves it!A tool "c2ats" resolves it!A tool "c2ats" resolves it!A tool "c2ats" resolves it!A tool "c2ats" resolves it!
☆ https://github.com/metasepi/c2ats/☆ https://github.com/metasepi/c2ats/☆ https://github.com/metasepi/c2ats/☆ https://github.com/metasepi/c2ats/☆ https://github.com/metasepi/c2ats/
☆ parse C header and generate ATS interface.☆ parse C header and generate ATS interface.☆ parse C header and generate ATS interface.☆ parse C header and generate ATS interface.☆ parse C header and generate ATS interface.
☆ made by Haskell language.☆ made by Haskell language.☆ made by Haskell language.☆ made by Haskell language.☆ made by Haskell language.
☆ using "language-c" library to parse C code.☆ using "language-c" library to parse C code.☆ using "language-c" library to parse C code.☆ using "language-c" library to parse C code.☆ using "language-c" library to parse C code.
7. We can do using c2ats...We can do using c2ats...We can do using c2ats...We can do using c2ats...We can do using c2ats...
8. Rule: Translating primitive typesRule: Translating primitive typesRule: Translating primitive typesRule: Translating primitive typesRule: Translating primitive types
ATS's unboxed type is one-to-one for C's one.ATS's unboxed type is one-to-one for C's one.ATS's unboxed type is one-to-one for C's one.ATS's unboxed type is one-to-one for C's one.ATS's unboxed type is one-to-one for C's one.
C�language��������│�ATS�language
------------------+------------------
bool��������������│�bool
char��������������│�char
signed�char�������│�schar
unsigned�char�����│�uchar
short�������������│�sint
unsigned�short����│�usint
int���������������│�int
unsigned�int������│�uint
long�int����������│�lint
unsigned�long�int�│�ulint
...���������������│�...
C�language��������│�ATS�language
------------------+------------------
bool��������������│�bool
char��������������│�char
signed�char�������│�schar
unsigned�char�����│�uchar
short�������������│�sint
unsigned�short����│�usint
int���������������│�int
unsigned�int������│�uint
long�int����������│�lint
unsigned�long�int�│�ulint
...���������������│�...
C�language��������│�ATS�language
------------------+------------------
bool��������������│�bool
char��������������│�char
signed�char�������│�schar
unsigned�char�����│�uchar
short�������������│�sint
unsigned�short����│�usint
int���������������│�int
unsigned�int������│�uint
long�int����������│�lint
unsigned�long�int�│�ulint
...���������������│�...
C�language��������│�ATS�language
------------------+------------------
bool��������������│�bool
char��������������│�char
signed�char�������│�schar
unsigned�char�����│�uchar
short�������������│�sint
unsigned�short����│�usint
int���������������│�int
unsigned�int������│�uint
long�int����������│�lint
unsigned�long�int�│�ulint
...���������������│�...
C�language��������│�ATS�language
------------------+------------------
bool��������������│�bool
char��������������│�char
signed�char�������│�schar
unsigned�char�����│�uchar
short�������������│�sint
unsigned�short����│�usint
int���������������│�int
unsigned�int������│�uint
long�int����������│�lint
unsigned�long�int�│�ulint
...���������������│�...
9. Rule: FunctionsRule: FunctionsRule: FunctionsRule: FunctionsRule: Functions
☆ If you have following C function declaration:☆ If you have following C function declaration:☆ If you have following C function declaration:☆ If you have following C function declaration:☆ If you have following C function declaration:
int�func_a(int,�char);int�func_a(int,�char);int�func_a(int,�char);int�func_a(int,�char);int�func_a(int,�char);
☆ c2ats generate following ATS interface:☆ c2ats generate following ATS interface:☆ c2ats generate following ATS interface:☆ c2ats generate following ATS interface:☆ c2ats generate following ATS interface:
fun�fun_c2ats_func_a:�(int,�char)�->�int�=�"mac#func_a"fun�fun_c2ats_func_a:�(int,�char)�->�int�=�"mac#func_a"fun�fun_c2ats_func_a:�(int,�char)�->�int�=�"mac#func_a"fun�fun_c2ats_func_a:�(int,�char)�->�int�=�"mac#func_a"fun�fun_c2ats_func_a:�(int,�char)�->�int�=�"mac#func_a"
11. Rule: Pointers and at-view #1Rule: Pointers and at-view #1Rule: Pointers and at-view #1Rule: Pointers and at-view #1Rule: Pointers and at-view #1
☆ If you have following C declaration:☆ If you have following C declaration:☆ If you have following C declaration:☆ If you have following C declaration:☆ If you have following C declaration:
int�getopt�(int�___argc,�char�**___argv,�char�*__shortopts);int�getopt�(int�___argc,�char�**___argv,�char�*__shortopts);int�getopt�(int�___argc,�char�**___argv,�char�*__shortopts);int�getopt�(int�___argc,�char�**___argv,�char�*__shortopts);int�getopt�(int�___argc,�char�**___argv,�char�*__shortopts);
☆ c2ats generate following ATS definition:☆ c2ats generate following ATS definition:☆ c2ats generate following ATS definition:☆ c2ats generate following ATS definition:☆ c2ats generate following ATS definition:
viewdef�ptr_v_1�(a:t@ype,�l:addr)�=�a�@�l
dataview�ptr_v_2�(a:t@ype+,�l0:�addr,�l1:�addr)�=
��│�ptr_v_2_cons(a,�l0,�l1)�of�(ptr�l1�@�l0,�ptr_v_1�(a,�l1))
fun�fun_c2ats_getopt:�{l1,l1_1,l2:addr}�(!ptr_v_2(char,�l1,�l1_1),�!ptr_v_1
(char,�l2)�│�int,�ptr�l1,�ptr�l2)�->�int�=�"mac#getopt"
viewdef�ptr_v_1�(a:t@ype,�l:addr)�=�a�@�l
dataview�ptr_v_2�(a:t@ype+,�l0:�addr,�l1:�addr)�=
��│�ptr_v_2_cons(a,�l0,�l1)�of�(ptr�l1�@�l0,�ptr_v_1�(a,�l1))
fun�fun_c2ats_getopt:�{l1,l1_1,l2:addr}�(!ptr_v_2(char,�l1,�l1_1),�!ptr_v_1
(char,�l2)�│�int,�ptr�l1,�ptr�l2)�->�int�=�"mac#getopt"
viewdef�ptr_v_1�(a:t@ype,�l:addr)�=�a�@�l
dataview�ptr_v_2�(a:t@ype+,�l0:�addr,�l1:�addr)�=
��│�ptr_v_2_cons(a,�l0,�l1)�of�(ptr�l1�@�l0,�ptr_v_1�(a,�l1))
fun�fun_c2ats_getopt:�{l1,l1_1,l2:addr}�(!ptr_v_2(char,�l1,�l1_1),�!ptr_v_1
(char,�l2)�│�int,�ptr�l1,�ptr�l2)�->�int�=�"mac#getopt"
viewdef�ptr_v_1�(a:t@ype,�l:addr)�=�a�@�l
dataview�ptr_v_2�(a:t@ype+,�l0:�addr,�l1:�addr)�=
��│�ptr_v_2_cons(a,�l0,�l1)�of�(ptr�l1�@�l0,�ptr_v_1�(a,�l1))
fun�fun_c2ats_getopt:�{l1,l1_1,l2:addr}�(!ptr_v_2(char,�l1,�l1_1),�!ptr_v_1
(char,�l2)�│�int,�ptr�l1,�ptr�l2)�->�int�=�"mac#getopt"
viewdef�ptr_v_1�(a:t@ype,�l:addr)�=�a�@�l
dataview�ptr_v_2�(a:t@ype+,�l0:�addr,�l1:�addr)�=
��│�ptr_v_2_cons(a,�l0,�l1)�of�(ptr�l1�@�l0,�ptr_v_1�(a,�l1))
fun�fun_c2ats_getopt:�{l1,l1_1,l2:addr}�(!ptr_v_2(char,�l1,�l1_1),�!ptr_v_1
(char,�l2)�│�int,�ptr�l1,�ptr�l2)�->�int�=�"mac#getopt"
12. Rule: Pointers and at-view #2Rule: Pointers and at-view #2Rule: Pointers and at-view #2Rule: Pointers and at-view #2Rule: Pointers and at-view #2
You can dereference pointer "ptr l1", "ptr l1_1",
"ptr l2" because they has own at-view.
You can dereference pointer "ptr l1", "ptr l1_1",
"ptr l2" because they has own at-view.
You can dereference pointer "ptr l1", "ptr l1_1",
"ptr l2" because they has own at-view.
You can dereference pointer "ptr l1", "ptr l1_1",
"ptr l2" because they has own at-view.
You can dereference pointer "ptr l1", "ptr l1_1",
"ptr l2" because they has own at-view.
13. Rule: Accessor for global variables #1Rule: Accessor for global variables #1Rule: Accessor for global variables #1Rule: Accessor for global variables #1Rule: Accessor for global variables #1
//�If�you�have�following�C�declaration:
struct�foo�{int�i;�char�*s;};
extern�struct�foo�g_foo;
//�If�you�have�following�C�declaration:
struct�foo�{int�i;�char�*s;};
extern�struct�foo�g_foo;
//�If�you�have�following�C�declaration:
struct�foo�{int�i;�char�*s;};
extern�struct�foo�g_foo;
//�If�you�have�following�C�declaration:
struct�foo�{int�i;�char�*s;};
extern�struct�foo�g_foo;
//�If�you�have�following�C�declaration:
struct�foo�{int�i;�char�*s;};
extern struct�foo�g_foo;
//�c2ats�generate�following�ATS�definition:
typedef�struct_c2ats_foo�=�$extype_struct"struct�foo"�of�{
��i�=�int,
��s�=�ptr�(*�cPtr0(char)�*)
}
macdef�takeout_c2ats_g_foo�=�$extval([l1:addr]�(ptr_v_1(struct_c2ats_foo,�
l1)�│�ptr�l1),�"&g_foo")
praxi�addback_c2ats_g_foo�{l1:addr}�(ptr_v_1(struct_c2ats_foo,�l1)�│�ptr�
l1):�void
//�c2ats�generate�following�ATS�definition:
typedef�struct_c2ats_foo�=�$extype_struct"struct�foo"�of�{
��i�=�int,
��s�=�ptr�(*�cPtr0(char)�*)
}
macdef�takeout_c2ats_g_foo�=�$extval([l1:addr]�(ptr_v_1(struct_c2ats_foo,�
l1)�│�ptr�l1),�"&g_foo")
praxi�addback_c2ats_g_foo�{l1:addr}�(ptr_v_1(struct_c2ats_foo,�l1)�│�ptr�
l1):�void
//�c2ats�generate�following�ATS�definition:
typedef�struct_c2ats_foo�=�$extype_struct"struct�foo"�of�{
��i�=�int,
��s�=�ptr�(*�cPtr0(char)�*)
}
macdef�takeout_c2ats_g_foo�=�$extval([l1:addr]�(ptr_v_1(struct_c2ats_foo,�
l1)�│�ptr�l1),�"&g_foo")
praxi�addback_c2ats_g_foo�{l1:addr}�(ptr_v_1(struct_c2ats_foo,�l1)�│�ptr�
l1):�void
//�c2ats�generate�following�ATS�definition:
typedef�struct_c2ats_foo�=�$extype_struct"struct�foo"�of�{
��i�=�int,
��s�=�ptr�(*�cPtr0(char)�*)
}
macdef�takeout_c2ats_g_foo�=�$extval([l1:addr]�(ptr_v_1(struct_c2ats_foo,�
l1)�│�ptr�l1),�"&g_foo")
praxi�addback_c2ats_g_foo�{l1:addr}�(ptr_v_1(struct_c2ats_foo,�l1)�│�ptr�
l1):�void
//�c2ats�generate�following�ATS�definition:
typedef�struct_c2ats_foo�=�$extype_struct"struct�foo"�of�{
��i�=�int,
��s�=�ptr�(*�cPtr0(char)�*)
}
macdef�takeout_c2ats_g_foo�=�$extval([l1:addr]�(ptr_v_1(struct_c2ats_foo,�
l1)�│�ptr�l1),�"&g_foo")
praxi�addback_c2ats_g_foo�{l1:addr}�(ptr_v_1(struct_c2ats_foo,�l1)�│�ptr�
l1):�void
14. Rule: Accessor for global variables #2Rule: Accessor for global variables #2Rule: Accessor for global variables #2Rule: Accessor for global variables #2Rule: Accessor for global variables #2
//�You�can�write�following�code�with�the�definition:
staload�"example.sats"
implement�main0�()�=�{
��//�g_foo
��val�(pfg_foo�│�g_foo)�=�takeout_c2ats_g_foo
��val�i�=�g_foo->i
��val�s�=�$UN.cast{string}(g_foo->s)
��val�()�=�println!�("g_foo�=�{",�i,�",�"",�s,�""}")
��val�()�=�assertloc�(i�=�1234)
��val�()�=�assertloc�(strcmp�("Hello,�world!",�s)�=�0)
��prval�()�=�addback_c2ats_g_foo�(pfg_foo�│�g_foo)
}
//�You�can�write�following�code�with�the�definition:
staload�"example.sats"
implement�main0�()�=�{
��//�g_foo
��val�(pfg_foo�│�g_foo)�=�takeout_c2ats_g_foo
��val�i�=�g_foo->i
��val�s�=�$UN.cast{string}(g_foo->s)
��val�()�=�println!�("g_foo�=�{",�i,�",�"",�s,�""}")
��val�()�=�assertloc�(i�=�1234)
��val�()�=�assertloc�(strcmp�("Hello,�world!",�s)�=�0)
��prval�()�=�addback_c2ats_g_foo�(pfg_foo�│�g_foo)
}
//�You�can�write�following�code�with�the�definition:
staload�"example.sats"
implement�main0�()�=�{
��//�g_foo
��val�(pfg_foo�│�g_foo)�=�takeout_c2ats_g_foo
��val�i�=�g_foo->i
��val�s�=�$UN.cast{string}(g_foo->s)
��val�()�=�println!�("g_foo�=�{",�i,�",�"",�s,�""}")
��val�()�=�assertloc�(i�=�1234)
��val�()�=�assertloc�(strcmp�("Hello,�world!",�s)�=�0)
��prval�()�=�addback_c2ats_g_foo�(pfg_foo�│�g_foo)
}
//�You�can�write�following�code�with�the�definition:
staload�"example.sats"
implement�main0�()�=�{
��//�g_foo
��val�(pfg_foo�│�g_foo)�=�takeout_c2ats_g_foo
��val�i�=�g_foo->i
��val�s�=�$UN.cast{string}(g_foo->s)
��val�()�=�println!�("g_foo�=�{",�i,�",�"",�s,�""}")
��val�()�=�assertloc�(i�=�1234)
��val�()�=�assertloc�(strcmp�("Hello,�world!",�s)�=�0)
��prval�()�=�addback_c2ats_g_foo�(pfg_foo�│�g_foo)
}
//�You�can�write�following�code�with�the�definition:
staload�"example.sats"
implement�main0�()�=�{
//�g_foo
val�(pfg_foo�│�g_foo)�=�takeout_c2ats_g_foo
val�i�=�g_foo->i
val�s�=�$UN.cast{string}(g_foo->s)
val�()�=�println!�("g_foo�=�{",�i,�",�"",�s,�""}")
val�()�=�assertloc�(i�=�1234)
val�()�=�assertloc�(strcmp�("Hello,�world!",�s)�=�0)
prval�()�=�addback_c2ats_g_foo�(pfg_foo�│�g_foo)
}
15. Unsafe ATS application on API #1Unsafe ATS application on API #1Unsafe ATS application on API #1Unsafe ATS application on API #1Unsafe ATS application on API #1
☆ First, generate ATS interfaces from C header:☆ First, generate ATS interfaces from C header:☆ First, generate ATS interfaces from C header:☆ First, generate ATS interfaces from C header:☆ First, generate ATS interfaces from C header:
$�cat�example.h
#include�<stdio.h>
$�c2ats�gen�example.h�>�example.sats
$�cat�example.sats
$�cat�example.h
#include�<stdio.h>
$�c2ats�gen�example.h�>�example.sats
$�cat�example.sats
$�cat�example.h
#include�<stdio.h>
$�c2ats�gen�example.h�>�example.sats
$�cat�example.sats
$�cat�example.h
#include�<stdio.h>
$�c2ats�gen�example.h�>�example.sats
$�cat�example.sats
$�cat�example.h
#include�<stdio.h>
$�c2ats�gen�example.h�>�example.sats
$�cat�example.sats
//--snip--
fun�fun_c2ats_fread:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fread"
fun�fun_c2ats_fwrite:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fwrite"
fun�fun_c2ats_fseek:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1,�
lint,�int)�->�int�=�"mac#fseek"
//--snip--
fun�fun_c2ats_fread:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fread"
fun�fun_c2ats_fwrite:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fwrite"
fun�fun_c2ats_fseek:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1,�
lint,�int)�->�int�=�"mac#fseek"
//--snip--
fun�fun_c2ats_fread:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fread"
fun�fun_c2ats_fwrite:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fwrite"
fun�fun_c2ats_fseek:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1,�
lint,�int)�->�int�=�"mac#fseek"
//--snip--
fun�fun_c2ats_fread:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fread"
fun�fun_c2ats_fwrite:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fwrite"
fun�fun_c2ats_fseek:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1,�
lint,�int)�->�int�=�"mac#fseek"
//--snip--
fun�fun_c2ats_fread:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fread"
fun�fun_c2ats_fwrite:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr,�
type_c2ats_size_t,�type_c2ats_size_t,�ptr�l1)�->�type_c2ats_size_t�=�
"mac#fwrite"
fun�fun_c2ats_fseek:�{l1:addr}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1,�
lint,�int)�->�int�=�"mac#fseek"
16. Unsafe ATS application on API #2Unsafe ATS application on API #2Unsafe ATS application on API #2Unsafe ATS application on API #2Unsafe ATS application on API #2
☆ Next, write ATS code with unsafe manner:☆ Next, write ATS code with unsafe manner:☆ Next, write ATS code with unsafe manner:☆ Next, write ATS code with unsafe manner:☆ Next, write ATS code with unsafe manner:
$�vi�main.dats$�vi�main.dats$�vi�main.dats$�vi�main.dats$�vi�main.dats
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�UN�=�"prelude/SATS/unsafe.sats"�//�Unsafe!
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example.sats"
extern�praxi�__create_view�{to:view}�():<prf>�to�//�Unsafe!
extern�praxi�__consume_view�{from:view}�(pf:�from):<prf>�void�//�Unsafe!
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�UN�=�"prelude/SATS/unsafe.sats"�//�Unsafe!
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example.sats"
extern�praxi�__create_view�{to:view}�():<prf>�to�//�Unsafe!
extern�praxi�__consume_view�{from:view}�(pf:�from):<prf>�void�//�Unsafe!
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�UN�=�"prelude/SATS/unsafe.sats"�//�Unsafe!
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example.sats"
extern�praxi�__create_view�{to:view}�():<prf>�to�//�Unsafe!
extern�praxi�__consume_view�{from:view}�(pf:�from):<prf>�void�//�Unsafe!
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�UN�=�"prelude/SATS/unsafe.sats"�//�Unsafe!
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example.sats"
extern�praxi�__create_view�{to:view}�():<prf>�to�//�Unsafe!
extern�praxi�__consume_view�{from:view}�(pf:�from):<prf>�void�//�Unsafe!
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�UN�=�"prelude/SATS/unsafe.sats"�//�Unsafe!
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example.sats"
extern praxi�__create_view�{to:view}�():<prf>�to�//�Unsafe!
extern praxi�__consume_view�{from:view}�(pf:�from):<prf>�void�//�Unsafe!
//�continue...
17. Unsafe ATS application on API #3Unsafe ATS application on API #3Unsafe ATS application on API #3Unsafe ATS application on API #3Unsafe ATS application on API #3
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�pn�=�string2ptr(file)
��val�(pfnat,�fpfnat�│�pn)�=�$UN.ptr_vtake(pn)�//�Unsafe!
��val�pm�=�string2ptr(mode)
��val�(pfmat,�fpfmat�│�pm)�=�$UN.ptr_vtake(pm)�//�Unsafe!
��val�(pffp�│�fp)�=�fun_c2ats_fopen(pfnat,�pfmat�│�pn,�pm)
��prval�()�=�fpfnat(pfnat)
��prval�()�=�fpfmat(pfmat)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�pn�=�string2ptr(file)
��val�(pfnat,�fpfnat�│�pn)�=�$UN.ptr_vtake(pn)�//�Unsafe!
��val�pm�=�string2ptr(mode)
��val�(pfmat,�fpfmat�│�pm)�=�$UN.ptr_vtake(pm)�//�Unsafe!
��val�(pffp�│�fp)�=�fun_c2ats_fopen(pfnat,�pfmat�│�pn,�pm)
��prval�()�=�fpfnat(pfnat)
��prval�()�=�fpfmat(pfmat)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�pn�=�string2ptr(file)
��val�(pfnat,�fpfnat�│�pn)�=�$UN.ptr_vtake(pn)�//�Unsafe!
��val�pm�=�string2ptr(mode)
��val�(pfmat,�fpfmat�│�pm)�=�$UN.ptr_vtake(pm)�//�Unsafe!
��val�(pffp�│�fp)�=�fun_c2ats_fopen(pfnat,�pfmat�│�pn,�pm)
��prval�()�=�fpfnat(pfnat)
��prval�()�=�fpfmat(pfmat)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�pn�=�string2ptr(file)
��val�(pfnat,�fpfnat�│�pn)�=�$UN.ptr_vtake(pn)�//�Unsafe!
��val�pm�=�string2ptr(mode)
��val�(pfmat,�fpfmat�│�pm)�=�$UN.ptr_vtake(pm)�//�Unsafe!
��val�(pffp�│�fp)�=�fun_c2ats_fopen(pfnat,�pfmat�│�pn,�pm)
��prval�()�=�fpfnat(pfnat)
��prval�()�=�fpfmat(pfmat)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
fun�my_fopen�(file:�string,�mode:�string):
[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
val�pn�=�string2ptr(file)
val�(pfnat,�fpfnat�│�pn)�=�$UN.ptr_vtake(pn)�//�Unsafe!
val�pm�=�string2ptr(mode)
val�(pfmat,�fpfmat�│�pm)�=�$UN.ptr_vtake(pm)�//�Unsafe!
val�(pffp�│�fp)�=�fun_c2ats_fopen(pfnat,�pfmat�│�pn,�pm)
prval�()�=�fpfnat(pfnat)
prval�()�=�fpfmat(pfmat)
val�()�=�assertloc(fp�>�0)
val�ret�=�(pffp�│�fp)
}
//�continue...
18. Unsafe ATS application on API #4Unsafe ATS application on API #4Unsafe ATS application on API #4Unsafe ATS application on API #4Unsafe ATS application on API #4
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:int]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strptr�=�strnptr2strptr(string_tabulate(len))
��val�buf_ptr�=�strptr2ptr(buf_strptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_ptr,�1UL,�$UN.cast2ulint(len),�fp)�//�
Unsafe!
��val�r�=�$UN.cast(r)�//�Unsafe!
��val�buf_strnptr�=�strptr2strnptr(buf_strptr)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:int]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strptr�=�strnptr2strptr(string_tabulate(len))
��val�buf_ptr�=�strptr2ptr(buf_strptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_ptr,�1UL,�$UN.cast2ulint(len),�fp)�//�
Unsafe!
��val�r�=�$UN.cast(r)�//�Unsafe!
��val�buf_strnptr�=�strptr2strnptr(buf_strptr)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:int]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strptr�=�strnptr2strptr(string_tabulate(len))
��val�buf_ptr�=�strptr2ptr(buf_strptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_ptr,�1UL,�$UN.cast2ulint(len),�fp)�//�
Unsafe!
��val�r�=�$UN.cast(r)�//�Unsafe!
��val�buf_strnptr�=�strptr2strnptr(buf_strptr)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:int]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strptr�=�strnptr2strptr(string_tabulate(len))
��val�buf_ptr�=�strptr2ptr(buf_strptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_ptr,�1UL,�$UN.cast2ulint(len),�fp)�//�
Unsafe!
��val�r�=�$UN.cast(r)�//�Unsafe!
��val�buf_strnptr�=�strptr2strnptr(buf_strptr)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
[m:int]�(size_t(m),�strnptr(m))�=�ret�where�{
implement{}�string_tabulate$fopr(s)�=�'_'
val�buf_strptr�=�strnptr2strptr(string_tabulate(len))
val�buf_ptr�=�strptr2ptr(buf_strptr)
val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
val�r�=�fun_c2ats_fread(pffp�│�buf_ptr,�1UL,�$UN.cast2ulint(len),�fp)�//�
Unsafe!
val�r�=�$UN.cast(r)�//�Unsafe!
val�buf_strnptr�=�strptr2strnptr(buf_strptr)
val�ret�=�(r,�buf_strnptr)
}
//�continue...
19. Unsafe ATS application on API #5Unsafe ATS application on API #5Unsafe ATS application on API #5Unsafe ATS application on API #5Unsafe ATS application on API #5
fun�my_fclose�{l:agz}�(pffp:�type_c2ats_FILE@l�│�fp:�ptr(l)):�int
����=�ret�where�{
��val�ret�=�fun_c2ats_fclose(pffp�│�fp)
��prval�()�=�__consume_view(pffp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
//�continue...
fun�my_fclose�{l:agz}�(pffp:�type_c2ats_FILE@l�│�fp:�ptr(l)):�int
����=�ret�where�{
��val�ret�=�fun_c2ats_fclose(pffp�│�fp)
��prval�()�=�__consume_view(pffp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
//�continue...
fun�my_fclose�{l:agz}�(pffp:�type_c2ats_FILE@l�│�fp:�ptr(l)):�int
����=�ret�where�{
��val�ret�=�fun_c2ats_fclose(pffp�│�fp)
��prval�()�=�__consume_view(pffp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
//�continue...
fun�my_fclose�{l:agz}�(pffp:�type_c2ats_FILE@l�│�fp:�ptr(l)):�int
����=�ret�where�{
��val�ret�=�fun_c2ats_fclose(pffp�│�fp)
��prval�()�=�__consume_view(pffp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
//�continue...
fun�my_fclose�{l:agz}�(pffp:�type_c2ats_FILE@l�│�fp:�ptr(l)):�int
����=�ret�where�{
val�ret�=�fun_c2ats_fclose(pffp�│�fp)
prval�()�=�__consume_view(pffp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
val�str�=�strnptr2strptr(str)
val�()�=�print(str)
val�()�=�free(str)
val�()�=�if�r�>�0 then�readshow(pffp�│�fp)
}
//�continue...
20. Unsafe ATS application on API #6Unsafe ATS application on API #6Unsafe ATS application on API #6Unsafe ATS application on API #6Unsafe ATS application on API #6
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�my_fclose(pffp�│�fp)
}
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�my_fclose(pffp�│�fp)
}
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�my_fclose(pffp�│�fp)
}
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�my_fclose(pffp�│�fp)
}
implement�main0�()�=�{
val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
val�()�=�readshow(pffp�│�fp)
val�r�=�my_fclose(pffp�│�fp)
}
22. Manually introduce linear type #2Manually introduce linear type #2Manually introduce linear type #2Manually introduce linear type #2Manually introduce linear type #2
☆ If you modify the interfaces with safe manner:☆ If you modify the interfaces with safe manner:☆ If you modify the interfaces with safe manner:☆ If you modify the interfaces with safe manner:☆ If you modify the interfaces with safe manner:
$�cp�example.sats�example_welltyped.sats
$�vi�example_welltyped.sats
$�cp�example.sats�example_welltyped.sats
$�vi�example_welltyped.sats
$�cp�example.sats�example_welltyped.sats
$�vi�example_welltyped.sats
$�cp�example.sats�example_welltyped.sats
$�vi�example_welltyped.sats
$�cp�example.sats�example_welltyped.sats
$�vi�example_welltyped.sats
//�--snip--
fun�fun_c2ats_fclose:�{l1:agz}�(ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1)�->�
int�=�"mac#fclose"
fun�fun_c2ats_fopen:�(string,�string)�->�[l3:addr]�(ptr_v_1(type_c2ats_FILE,�
l3)�│�ptr�l3)�=�"mac#fopen"
fun�fun_c2ats_fread:�{l1:agz}{n,m:nat}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�!
strnptr(n*m)>>strnptr(o),�size_t(n),�size_t(m),�ptr�l1)�->�#[o:nat�│�o�<=�
n*m]�size_t(o)�=�"mac#fread"
//�--snip--
fun�fun_c2ats_fclose:�{l1:agz}�(ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1)�->�
int�=�"mac#fclose"
fun�fun_c2ats_fopen:�(string,�string)�->�[l3:addr]�(ptr_v_1(type_c2ats_FILE,�
l3)�│�ptr�l3)�=�"mac#fopen"
fun�fun_c2ats_fread:�{l1:agz}{n,m:nat}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�!
strnptr(n*m)>>strnptr(o),�size_t(n),�size_t(m),�ptr�l1)�->�#[o:nat�│�o�<=�
n*m]�size_t(o)�=�"mac#fread"
//�--snip--
fun�fun_c2ats_fclose:�{l1:agz}�(ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1)�->�
int�=�"mac#fclose"
fun�fun_c2ats_fopen:�(string,�string)�->�[l3:addr]�(ptr_v_1(type_c2ats_FILE,�
l3)�│�ptr�l3)�=�"mac#fopen"
fun�fun_c2ats_fread:�{l1:agz}{n,m:nat}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�!
strnptr(n*m)>>strnptr(o),�size_t(n),�size_t(m),�ptr�l1)�->�#[o:nat�│�o�<=�
n*m]�size_t(o)�=�"mac#fread"
//�--snip--
fun�fun_c2ats_fclose:�{l1:agz}�(ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1)�->�
int�=�"mac#fclose"
fun�fun_c2ats_fopen:�(string,�string)�->�[l3:addr]�(ptr_v_1(type_c2ats_FILE,�
l3)�│�ptr�l3)�=�"mac#fopen"
fun�fun_c2ats_fread:�{l1:agz}{n,m:nat}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�!
strnptr(n*m)>>strnptr(o),�size_t(n),�size_t(m),�ptr�l1)�->�#[o:nat�│�o�<=�
n*m]�size_t(o)�=�"mac#fread"
//�--snip--
fun�fun_c2ats_fclose:�{l1:agz}�(ptr_v_1(type_c2ats_FILE,�l1)�│�ptr�l1)�->�
int�=�"mac#fclose"
fun�fun_c2ats_fopen:�(string,�string)�->�[l3:addr]�(ptr_v_1(type_c2ats_FILE,�
l3)�│�ptr�l3)�=�"mac#fopen"
fun�fun_c2ats_fread:�{l1:agz}{n,m:nat}�(!ptr_v_1(type_c2ats_FILE,�l1)�│�!
strnptr(n*m)>>strnptr(o),�size_t(n),�size_t(m),�ptr�l1)�->�#[o:nat�│�o�<=�
n*m]�size_t(o)�=�"mac#fread"
23. Manually introduce linear type #3Manually introduce linear type #3Manually introduce linear type #3Manually introduce linear type #3Manually introduce linear type #3
☆ you can rite safe application:☆ you can rite safe application:☆ you can rite safe application:☆ you can rite safe application:☆ you can rite safe application:
$�vi�main.dats$�vi�main.dats$�vi�main.dats$�vi�main.dats$�vi�main.dats
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example_welltyped.sats"
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�(pffp�│�fp)�=�fun_c2ats_fopen(file,�mode)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example_welltyped.sats"
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�(pffp�│�fp)�=�fun_c2ats_fopen(file,�mode)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example_welltyped.sats"
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�(pffp�│�fp)�=�fun_c2ats_fopen(file,�mode)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example_welltyped.sats"
fun�my_fopen�(file:�string,�mode:�string):
����[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
��val�(pffp�│�fp)�=�fun_c2ats_fopen(file,�mode)
��val�()�=�assertloc(fp�>�0)
��val�ret�=�(pffp�│�fp)
}
//�continue...
#include�"share/atspre_define.hats"
#include�"share/atspre_staload.hats"
staload�STRING�=�"libats/libc/SATS/string.sats"
staload�"example_welltyped.sats"
fun�my_fopen�(file:�string,�mode:�string):
[l:agz]�(type_c2ats_FILE@l�│�ptr(l))�=�ret�where�{
val�(pffp�│�fp)�=�fun_c2ats_fopen(file,�mode)
val�()�=�assertloc(fp�>�0)
val�ret�=�(pffp�│�fp)
}
//�continue...
24. Manually introduce linear type #4Manually introduce linear type #4Manually introduce linear type #4Manually introduce linear type #4Manually introduce linear type #4
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:nat�│�m�<=�n]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strnptr�=�string_tabulate(len)
��val�buf_ptr�=�strnptr2ptr(buf_strnptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_strnptr,�i2sz(1),�len,�fp)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:nat�│�m�<=�n]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strnptr�=�string_tabulate(len)
��val�buf_ptr�=�strnptr2ptr(buf_strnptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_strnptr,�i2sz(1),�len,�fp)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:nat�│�m�<=�n]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strnptr�=�string_tabulate(len)
��val�buf_ptr�=�strnptr2ptr(buf_strnptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_strnptr,�i2sz(1),�len,�fp)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
����[m:nat�│�m�<=�n]�(size_t(m),�strnptr(m))�=�ret�where�{
��implement{}�string_tabulate$fopr(s)�=�'_'
��val�buf_strnptr�=�string_tabulate(len)
��val�buf_ptr�=�strnptr2ptr(buf_strnptr)
��val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
��val�r�=�fun_c2ats_fread(pffp�│�buf_strnptr,�i2sz(1),�len,�fp)
��val�ret�=�(r,�buf_strnptr)
}
//�continue...
fun�my_fread�{l:agz}{n:nat}
����(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l),�len:�size_t(n)):
[m:nat�│�m�<=�n]�(size_t(m),�strnptr(m))�=�ret�where�{
implement{}�string_tabulate$fopr(s)�=�'_'
val�buf_strnptr�=�string_tabulate(len)
val�buf_ptr�=�strnptr2ptr(buf_strnptr)
val�_�=�$STRING.memset_unsafe(buf_ptr,�0,�len)
val�r�=�fun_c2ats_fread(pffp�│�buf_strnptr,�i2sz(1),�len,�fp)
val�ret�=�(r,�buf_strnptr)
}
//�continue...
25. Manually introduce linear type #5Manually introduce linear type #5Manually introduce linear type #5Manually introduce linear type #5Manually introduce linear type #5
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�fun_c2ats_fclose(pffp�│�fp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�fun_c2ats_fclose(pffp�│�fp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�fun_c2ats_fclose(pffp�│�fp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
��val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
��val�str�=�strnptr2strptr(str)
��val�()�=�print(str)
��val�()�=�free(str)
��val�()�=�if�r�>�0�then�readshow(pffp�│�fp)
}
implement�main0�()�=�{
��val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
��val�()�=�readshow(pffp�│�fp)
��val�r�=�fun_c2ats_fclose(pffp�│�fp)
}
fun�readshow�{l:agz}�(pffp:�!type_c2ats_FILE@l�│�fp:�ptr(l)):�void�=�{
val�(r,�str)�=�my_fread(pffp�│�fp,�i2sz(128))
val�str�=�strnptr2strptr(str)
val�()�=�print(str)
val�()�=�free(str)
val�()�=�if�r�>�0 then�readshow(pffp�│�fp)
}
implement�main0�()�=�{
val�(pffp�│�fp)�=�my_fopen("main.dats",�"r")
val�()�=�readshow(pffp�│�fp)
val�r�=�fun_c2ats_fclose(pffp�│�fp)
}
26. Future planFuture planFuture planFuture planFuture plan
☆ Hongwei, who is author of ATS, said:☆ Hongwei, who is author of ATS, said:☆ Hongwei, who is author of ATS, said:☆ Hongwei, who is author of ATS, said:☆ Hongwei, who is author of ATS, said:
"Once�you�become�familiar�with�ATS,�you�can�readily�visualize�the�C�code�
that�your�ATS�source�is�to�be�compiled�into."
"Once�you�become�familiar�with�ATS,�you�can�readily�visualize�the�C�code�
that�your�ATS�source�is�to�be�compiled�into."
"Once�you�become�familiar�with�ATS,�you�can�readily�visualize�the�C�code�
that�your�ATS�source�is�to�be�compiled�into."
"Once�you�become�familiar�with�ATS,�you�can�readily�visualize�the�C�code�
that�your�ATS�source�is�to�be�compiled�into."
"Once�you�become�familiar�with�ATS,�you�can�readily�visualize�the�C�code�
that�your�ATS�source�is�to�be�compiled�into."
☆ So, we can create decompiler for ATS language?☆ So, we can create decompiler for ATS language?☆ So, we can create decompiler for ATS language?☆ So, we can create decompiler for ATS language?☆ So, we can create decompiler for ATS language?
27. ConclusionConclusionConclusionConclusionConclusion
☆ ATS code is more safe than C code.☆ ATS code is more safe than C code.☆ ATS code is more safe than C code.☆ ATS code is more safe than C code.☆ ATS code is more safe than C code.
☆ The c2ats generates ATS interface from C header.☆ The c2ats generates ATS interface from C header.☆ The c2ats generates ATS interface from C header.☆ The c2ats generates ATS interface from C header.☆ The c2ats generates ATS interface from C header.
☆ Unsafe ATS application can run on the interface.☆ Unsafe ATS application can run on the interface.☆ Unsafe ATS application can run on the interface.☆ Unsafe ATS application can run on the interface.☆ Unsafe ATS application can run on the interface.
☆ Make safety of the application with introducing
linear type manually.
☆ Make safety of the application with introducing
linear type manually.
☆ Make safety of the application with introducing
linear type manually.
☆ Make safety of the application with introducing
linear type manually.
☆ Make safety of the application with introducing
linear type manually.