=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BrainFuck Programming Tutorial by: Katie
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| /* | |
| * Copyright (C) 2011 Joseph Adams <[email protected]> | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: | |
| * |
| s x y z = x z (y z) | |
| k x y = x | |
| i = s k k | |
| c = s (s (k (s (k s) k)) s) (k k) | |
| b = s (k s) k | |
| hello = | |
| s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s | |
| b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(c k)))))))))))))))))))))))))))))))))))))))))) | |
| )))))))))))))))))))))))))))(s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s |
| discard """ | |
| Run as following. | |
| $ nim c -r binary_tree.nim | |
| """ | |
| type | |
| Node*[T] = ref NodeObj[T] | |
| NodeObj[T] = object | |
| left: Node[T] | |
| right: Node[T] |
| 000(023Rb|001Rb) | |
| 001(017La|002Rb) | |
| 002(021La|003Rb) | |
| 003(021La|004La) | |
| 004(009Rb|005Lb) | |
| 005(004Ra|005La) | |
| 006(008La|007La) | |
| 007(009Rb|007La) | |
| 008(009Ra|008La) | |
| 009(010Ra|026Ra) |
| 1 aesdeclast | |
| 1 aesimc | |
| 1 cmovp | |
| 1 fcmovbe | |
| 1 fcmove | |
| 1 fcmovnbe | |
| 1 fdivr | |
| 1 fdivs | |
| 1 fild | |
| 1 fmuls |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
| #!/usr/bin/env python3 | |
| import re | |
| import subprocess | |
| """ | |
| This is a ridiculous interpreter for the joke esoteric programming language APLBAONWSJAS | |
| see https://esolangs.org/wiki/APLBAONWSJAS for details. | |
| !!!WARNING!!! this takes user input and runs it without checking as system commands, | |
| this could have unintended consequences, and what you type could make changes to your |
This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.
It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.
Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2
The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and
A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.
Syntax emits zero JavaScript.
type RESULT = VM<
[
["push", N_1], // 1
["push", False], // 2
["peek", _], // 3