All Projects → Hypercubed → f-flat_node

Hypercubed / f-flat_node

Licence: other
F♭ (pronounced F-flat) is a toy language.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to f-flat node

charm
A [ functional stack ] based language.
Stars: ✭ 26 (+18.18%)
Mutual labels:  stack, concatenative-language
odin
High level 2d game engine written in Haskell.
Stars: ✭ 28 (+27.27%)
Mutual labels:  stack
ElectricalEngineering.jl
Julia electrical engineering package
Stars: ✭ 22 (+0%)
Mutual labels:  complex-numbers
uniprof
A stack tracer/profiler for Xen domains
Stars: ✭ 29 (+31.82%)
Mutual labels:  stack
Competitive Programming
Contains solutions and codes to various online competitive programming challenges and some good problems. The links to the problem sets are specified at the beginning of each code.
Stars: ✭ 65 (+195.45%)
Mutual labels:  stack
Fatou.jl
Fatou sets in Julia (Fractals, Newton basins, Mandelbrot)
Stars: ✭ 92 (+318.18%)
Mutual labels:  complex-numbers
ult
The Ultimate Dev Stack
Stars: ✭ 54 (+145.45%)
Mutual labels:  stack
arraydeque
A circular buffer with fixed capacity (Rust).
Stars: ✭ 82 (+272.73%)
Mutual labels:  stack
flask-powered
List of companies using Flask framework - who is using Flask?
Stars: ✭ 123 (+459.09%)
Mutual labels:  stack
takomo
Organize, parameterize and deploy your CloudFormation stacks
Stars: ✭ 27 (+22.73%)
Mutual labels:  stack
Algorithms
Data Structures & Algorithms. Includes solutions for Cracking the Coding Interview 6th Edition
Stars: ✭ 89 (+304.55%)
Mutual labels:  stack
wok
Compiler that has been integrated into Okami now
Stars: ✭ 21 (-4.55%)
Mutual labels:  concatenative-language
DEPRECATED-data-structures
A collection of powerful data structures
Stars: ✭ 2,648 (+11936.36%)
Mutual labels:  stack
con
A simple, fast and readable JSON-compatible serialization format
Stars: ✭ 22 (+0%)
Mutual labels:  con
Competitive Coding
Contains Solution for all type of Problems of Competitive Programming. Updates Frequently as any problem is solved.
Stars: ✭ 16 (-27.27%)
Mutual labels:  stack
Ripple-Auto-Installer
OSU! Ripple Stack Installation Helper
Stars: ✭ 21 (-4.55%)
Mutual labels:  stack
TIFFStack
Load TIFF files into matlab fast, with lazy loading
Stars: ✭ 32 (+45.45%)
Mutual labels:  stack
flutter examples
Random flutter examples
Stars: ✭ 18 (-18.18%)
Mutual labels:  stack
qaz
qaz—A CLI tool for Templating & Managing stacks in AWS Cloudformation
Stars: ✭ 89 (+304.55%)
Mutual labels:  stack
StackFlowView
Enforce stack behaviour for custom UI flow.
Stars: ✭ 35 (+59.09%)
Mutual labels:  stack

F♭

F♭ (pronounced F-flat) is a toy language.

F♭ is a dynamically typed array-oriented concatenative language like Forth, Joy, and others. F♭ is meant to be used interactively, for example in a CLI REPL, like R or the command shell, or in a stack based calculator. This constraint dictates many of the language features.

Features

Flat functional concatenative language

Stack based

RPN

Dynamic Types

Arbitrary-precision decimal and complex number type.

JSON format is a valid f-flat programs.

Why?

  • Designing a programming language in another language is a great way to learn about programming languages in general and the host language in particular.

  • Concatenative languages, with inherent functional composition, are a great way to explore functional programming and mathematics. Higher order functions (including math functions) are composed of smaller functions.

  • Because 0.1 + 0.2 = 0.3 and sqrt of -1 is not "not a number".

Example

asciicast

Welcome to F♭ REPL Interpreter
F♭ Version 0.0.0 (C) 2000-2017 J. Harshbarger

f♭> 0.1 0.2 +
[ 0.3 ]

f♭> 0.3 =
[ true ]

f♭> clr
[]

f♭> -1 sqrt
[ 0+1i ]

f♭> 1 atan 4 *
[ 0+1i, 3.1415926535897932385 ]

f♭> * exp
[ -1-3.7356616720497115803e-20i ]

f♭> abs
[ 1 ]

f♭> clr
[]

f♭> "mersenne?" [ 2 swap ^ 1 - prime? ] ;
[]

f♭> 10 integers
[ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ]

f♭> [ mersenne? ] map
[ [ true, true, true, false, true, false, true, false, false, false ] ]

f♭> clr
[]

f♭> 1000 !
[ 4.0238726007709377384e+2567 ]

f♭> clr
[]

f♭> i !
[ 0.49801566811835599106-0.15494982830181068731i ]

f♭> { first: "Manfred" }
[ { first: 'Manfred' } ]

f♭> { last: 'von Thun' }
[ { first: 'Manfred' }, { last: 'von Thun' } ]

f♭> +
[ { first: 'Manfred', last: 'von Thun' } ]

f♭> clr
[  ]

f♭> [ 1 2 3 ]
[ [ 1 2 3 ] ]

f♭> dup
[ [ 1 2 3 ] [ 1 2 3 ] ]

f♭> [ 2 * ]
[ [ 1 2 3 ] [ 1 2 3 ] [ 2 * ] ]

f♭> map
[ [ 1 2 3 ] [ 2 4 6 ] ]

f♭> +
[ [ 1 2 3 2 4 6 ] ]

f♭> +
[ [ 1 2 3 2 4 6 ] ]

f♭> clr
[  ]

f♭> dbl-sqr-cat: [ dup [ 2 * ] map + ] ;
[  ]

f♭> [ 1 2 3 ]
[ [ 1 2 3 ] ]

f♭>  dbl-sqr-cat
[ [ 1 2 3 2 4 6 ] ]

f♭> 'dbl-sqr-cat' see
[ '[ dup [ 2 * ] map + ]' ]

f♭> drop
[  ]

f♭> dbl-sqr-cat: expand
[ dup,2,*,*,Symbol((),swap,eval,dequote,+ ]

See other examples and guides here.

Project Goals

  • conceptually simple
  • interactive first
    • minimal hidden state
    • easy to type and read
    • reads left to right, top to bottom
    • whitespace not significant syntax
    • no lambdas/parameters
    • interactive development
    • case insensitive
  • flat concatenative language
    • name code not values
    • multiple return values
    • concatenation is composition/pipeline style
    • no unnecessary parentheses
  • no surprises
    • immutable data
    • arbitrary-precision decimal and complex numbers
    • percent values
    • both double and single quotes
    • returns error objects (TBD)
  • pure functions
  • host language interface (TBD)
  • session saving (TBD)
    • undo/redo
    • state is serializable (TBD)
  • modules, namespaces, and "closures"

Influences

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].