Learn red - fundamentals of red get up and running with the red language for full-stack development
Discover how to use the next-generation language Red for full-stack development, from systems coding over user-interfaces to blockchain programming About This Book Explore the latest features of Red to build scalable, fast, and secure applications Learn graphical programming and build highly sophist...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham ; London :
Packt Publishing
2018.
|
Edición: | 1st edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631464006719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Dedication
- Packt Upsell
- Foreword
- Contributors
- Table of Contents
- Preface
- Chapter 1: Red's Mission
- Technical requirements
- A short history of Red
- What Red stands for
- Some history
- What makes Red special?
- A full-stack language - from the metal to the meta
- Code is data and data is code
- Data types built in
- Small toolchain and executables
- Dialects
- Red's main features
- Portability
- Like a Swiss Army knife
- Summary
- Questions
- Chapter 2: Setting Up for Development
- Technical requirements
- Installing Red
- Installing Red on Windows
- Installing Red on Linux and macOS
- A look at the source code
- Working interactively in the Red console
- Running and compiling your first script
- Executing a script in the Red console
- Compiling a script to an executable
- Development mode
- Release mode
- Other compilation options
- Red's compilation model
- Development environments for writing Red
- Simple text editors
- More sophisticated editors
- Summary
- Questions
- Chapter 3: Using Words, Values, and Types
- Technical requirements
- Understanding words and values
- Some common datatypes
- Using blocks and parens
- Comments
- Word bindings
- Inferring types
- Assigning and copying
- Working with words
- More about types
- Converting types
- The type system
- Evaluating expressions and blocks
- Some basic operations
- Working with Boolean values
- Working with numbers
- Making random objects
- Order of evaluation
- Evaluation with do and reduce
- The structure of a Red program
- Summary
- Questions
- Further reading
- Chapter 4: Code-Controlling Structures
- Technical requirements
- Getting input from the user - input and ask
- Testing conditions
- if
- unless
- either
- Stopping a program - halt or quit.
- switch and case
- catch and throw
- Structuring repetitions
- Repeating a number of times - loop or repeat
- Repeating with a condition - while or until
- A number-guessing game
- Handling errors
- attempt and try
- Using error?
- Creating and catching errors
- Checking types
- Summary
- Questions
- Chapter 5: Working with Series and Blocks
- Technical requirements
- Series and blocks
- Navigating and looping through a series
- A step at a time - head, tail, index?, and next
- Looping through a series - foreach and forall
- Getting information from a series
- Selecting an item - pick and /
- Searching for an item - select and find
- Sorting
- Changing a series
- Changing items - poke, replace, and change
- Adding new items - append, repend, and insert
- append
- repend
- insert
- Deleting items - remove and take
- Moving items - move and swap
- Series as sets
- Copying a series
- Strings as series
- Splitting a string - split
- Turning a series into a string - form
- Rejoining a block - rejoin
- Clearing part of a string - clear and trim
- Adding to a string - append and insert
- Other useful tricks
- Summary
- Questions
- Chapter 6: Using Functions and Objects
- Technical requirements
- A fauna of functions
- The do word
- The does word
- The has word
- The func word
- The function word
- Copying a local series
- Function attributes
- Passing arguments
- Typing arguments
- Return values - return and exit
- Refinements
- Code style and documentation strings
- Working with functions
- Error handling
- Recursive functions
- Importing functions with do
- Code is data and data is code
- Using reflection on functions
- The source word
- The body-of function
- Changing the header and body of a function through code
- Code is just data - load
- Using objects
- The make word.
- Working with objects
- Creating objects
- Working with fields and functions
- Copying objects and inheritance
- Looking inside an object
- Summary
- Questions
- Chapter 7: Working with Files
- Technical requirements
- Selecting a file or folder
- Working with file paths and directories
- Reading and writing data files
- Working with binary files
- The image! datatype
- Downloading a file from the internet
- Loading and saving files
- Saving and loading the console history
- Downloading currency exchange rates
- Using query string parameters
- Summary
- Questions
- Chapter 8: Parsing Data
- Technical requirements
- The bitset! datatype
- Understanding how parse works
- First parse examples
- Using some and any
- Matching positions
- Choosing with |
- Searching, extracting, and changing
- Working with variables - to, thru, and copy
- Executing code on a match
- Changing data - change, remove, and insert
- More features and examples
- Using end
- Building special languages
- Changing a rule on the fly
- Parsing blocks and code
- Debugging parse
- Summary
- Questions
- Chapter 9: Composing Visual Interfaces
- Technical requirements
- Structuring an interface
- First example - a screen for downloading exchange rates
- Running the example
- Examining the code
- Building a layout
- Faces and actions
- Two-way binding
- Container settings - view
- Changing an app's icon
- View's refinements
- Using do in view
- Layout commands
- A faces walkthrough
- Base, box, and image
- Text faces - h1, text, field, and area
- Button, check, and radio
- List faces - text-list, drop-list, and drop-down
- Panel, group-box, and tab-panel
- Progress bar and slider
- Styles
- Events and actors
- Multiple events
- Timer event
- Actors are objects
- Detecting the keyboard
- Menus
- Basic contacts app.
- An introduction to the draw dialect
- Summary
- Questions
- Further reading
- Chapter 10: Advanced Red
- Technical requirements
- Reactive programming
- Red/System
- Comparing Red and Red/System
- Calling a Red/System script from within Red
- Interacting with the operating system
- Getting input from command-line arguments
- Calling an external program - call
- Using the OS clipboard - read-clipboard
- Datatypes for performance
- The vector! datatype
- The map! and hash! datatypes
- Embedded Red and macros
- Embedded Red
- Macros
- Red for smart contract programming
- Red/C3
- Using Red for writing dapps
- Red's roadmap
- Some useful references
- Summary
- Questions
- Further reading
- Assessments
- Other Books You May Enjoy
- Index.