Front Page All Articles Recent Changes Random Article

Contents

Concatenative language

  • ACL
  • Ait
  • Aocla
  • Breeze
  • Callisto
  • Cat
  • Cognate
  • colorForth
  • Concata
  • CoSy
  • Deque
  • DSSP
  • dt
  • Elymas
  • Enchilada
  • ETAC
  • F
  • Factor
  • Fiveth
  • Forth
  • Fourth
  • Freelang
  • Gershwin
  • hex
  • iNet
  • Joy
  • Joy of Postfix App
  • kcats
  • Kitten
  • lang5
  • Listack
  • LSE64
  • Lviv
  • Meow5
  • min
  • Mirth
  • mjoy
  • Mlatu
  • Ode
  • OForth
  • Om
  • Onyx
  • Plorth
  • Popr
  • Porth
  • PostScript
  • Prowl
  • Quest32
  • Quackery
  • r3
  • Raven
  • Retro
  • RPL
  • SPL
  • Staapl
  • Stabel
  • Tal
  • Titan
  • Trith
  • Uiua
  • Worst
  • xs
  • XY
  • 5th
  • 8th

Concatenative topics

  • Compilers
  • Interpreters
  • Type systems
  • Object systems
  • Quotations
  • Variables
  • Garbage collection
  • Example programs

Concatenative meta

  • People
  • Communities

Other languages

  • APL
  • C++
  • Erlang
  • FP trivia
  • Haskell
  • Io
  • Java
  • JavaScript
  • Lisp
  • ML
  • Oberon
  • RPL
  • Self
  • Slate
  • Smalltalk

Meta

  • Search
  • Farkup wiki format
  • Etiquette
  • Sandbox

Tal

Tal or Uxntal is a stack-based assembly language for the Uxn virtual machine designed to work within a 16-bit addressing space. It is a small stack-based computer specialized for building small, low-energy, audio-visual applications with a napkin-size specification and implementation in 100 lines of C. Finally, it powers the personal computing stack called Varvara.

@fib ( num* -- numfib* )
	#0001 GTH2k ?{ POP2 JMP2r }
	SUB2k fib STH2 INC2
	SUB2 fib STH2r ADD2
	JMP2r

The Uxn specification provides Tal with two 256 bytes circular stacks and 64kb of RAM. The language features support for anonymous functions, and arity checking.

FizzBuzz Implementation

@on-reset ( -> )
	#6400
	&loop ( -- )
		DUP <print-dec>
		#2018 DEO
		DUP #03 DIVk MUL SUB ?{ ;dict/fizz <print-str>/ }
		DUP #05 DIVk MUL SUB ?{ ;dict/buzz <print-str>/ }
		#0a18 DEO
		INC GTHk ?&loop
	POP2
	( exit ) #800f DEO
	BRK

@<print-dec> ( num -- )
	( x0 ) DUP #0a DIV <print-num>
	( 0x ) #0a DIVk MUL SUB
	( >> )

@<print-num> ( num -- )
	#30 ADD #18 DEO
	JMP2r

@<print-str> ( addr* -- )
	LDAk #18 DEO
	INC2 & LDAk ?<print-str>
	POP2 JMP2r

@dict ( strings )
	&fizz "Fizz $1
	&buzz "Buzz $1

This revision created on Sun, 17 Mar 2024 18:27:18 by neauoire

Latest Revisions Edit

All content is © 2008-2024 by its respective authors. By adding content to this wiki, you agree to release it under the BSD license.