or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Aiken programming language tutorial
thuc.nc@teko.vn
Note:
Speaker notes here
Aiken as a Cardano Smart Contract language
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Cardano Smart Contract Programming language
Aiken programming language
Sample Aiken code
https://danolearn.com/en/ucode/quick-sort-59119
Aiken as a functional programming language
Functiontal vs non-functional
Functiontal vs non-functional: example
vs
Functional Programming – Characteristics
Note:
Functional Programming – Pros & Cons
Pros
Cons
Note:
Aiken language tutorial
Aiken language tutorial
list
bytearray
dict
Variables & Primitive types
Variables & Constants
#define
in C/C++.Primitive Types
42
,14
,1_000_000
+
,-
,*
,/
(integer division),*
,%
==
,>
,<
,>=
,<=
True
,False
==
,&&
,||
,!
Note:
Primitive Types
0
to255
)"foo"
#[102, 111, 111]
#[0x66, 0x6f, 0x6f]
#"666f6f"
Primitive Types
(10, "hello")
(Int, ByteArray)(1, 4, [0])
(Int, Int, List<Int>)Primitive Types
Primitive Types
Functions
User-defined function
Labeled arguments
Pipe Operator
Pipe operator:
|>
- passing the result of one function to the arguments of another function.Function capturing
Note:
Backpassing: TDB
Generic functions
Note:
Similar to function template in C/C++
Unit Tests with aiken
Unit Tests with aiken
https://danolearn.com/en/ucode/add-one-59120
Unit Tests with aiken
https://danolearn.com/en/ucode/add-one-59120
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Control Flow
if else
when {expr} is
Blocks
Every block in Aiken is an expression with the value of the last expression in that block.
Branching with
if else
Note:
While it may look like an imperative instruction: if this then do that or else do that, it is in fact one single expression. This means, in particular, that the return types of both branches have to match.
Matching with
when {expr} is
Destructuring
Note:
A when expr is expression can be used to destructure values that contain other values, such as tuples and lists.
Modules
aiken/math
aiken/int
aiken/interval
aiken/list
aiken/bytearray
aiken/dict
Module imports
use
.Built-in modules
aiken/math
abs(self: Int) -> Int
gcd(x: Int, y: Int) -> Int
max(a: Int, b: Int) -> Int
min(a: Int, b: Int) -> Int
pow(self: Int, e: Int) -> Int
sqrt(self: Int) -> Option<Int>
Practice Exercises P1
https://danolearn.com/en/course-study/blockchain-crash-course-from-fundamentals-to-dapps-development-1462?l=54427
Working with
list
count, length
all, any
Indexing
Slicing
Slicing
Searching
Sorting
Filtering
Mapping
Reducing (Folding)
sum
,product
,max
,min
,concat_all
reverse
Reducing (Folding)
Reducing (Folding)
Reducing (Folding)
Practice Exercises P2
https://danolearn.com/en/course-study/blockchain-crash-course-from-fundamentals-to-dapps-development-1462?l=54429
Working with
bytearray
&dict
Practice Exercises P3
https://danolearn.com/en/course-study/blockchain-crash-course-from-fundamentals-to-dapps-development-1462?l=54430
Aiken development toolchain
The End
thuc.nc@teko.vn