For more contact methods and ways to donate, visit my website: https://benbusby.com.
benbusby / y2k Goto Github PK
View Code? Open in Web Editor NEWA 0-byte programming language encoded in pre-2000 timestamps
License: Mozilla Public License 2.0
A 0-byte programming language encoded in pre-2000 timestamps
License: Mozilla Public License 2.0
For more contact methods and ways to donate, visit my website: https://benbusby.com.
Currently there isn't a way to define a negative value.
The easiest way to approach this would be to create new variable types that are "negative" versions of existing or future data types (int
-> -int
, float
-> -float
), but that would mean consuming slots of variable types, which is maxed out at 9 (unless we want to enforce 2-digit parsing for complex data types in the future). It would also mean some potentially weird handling of those variables. For example, we wouldn't want to write separate cases for how to handle +=
of a negative vs positive integer.
Another approach would be to add another public element to Y2KVar
that would toggle negative/positive for that variable. I'm reluctant to do that though, since that value wouldn't really make sense for string
types, so it would be a wasted cycle.
I'm open to suggestion on how to implement this.
Depends on how #1 is implemented, and is maybe a little goofy, but it might be nice to be able to quickly visually parse what a raw.y2k
file contains, where lines starting with different commands are highlighted different colors, and comments are highlighted in an obvious color.
This is obviously heavily editor dependent, but would be neat if there was at least a Vim syntax theme and maybe support in Pygments.
Basically the syntax seen in the "Fizz Buzz" example, or the example given in the FAQ, but parseable by the interpreter. It would need the following features:
:
character in documentation, but open to suggestion forThe basic process should work like the following:
1 - Write a "raw.y2k" file
: raw.y2k
502 : Switch interpreter to 2 digit parsing
09 01 34 05 12 12 15 00 49 15 18 12 04 63 : Print "Hello World!"
00 00 : End print
2 - Test functionality with raw file
$ y2k -raw raw.y2k
Hello World!
3 - Convert raw file to regular Y2K files with their timestamps modified
$ y2k -convert raw.y2k
./1.y2k
./2.y2k
$ date +%s%9N -r 1.y2k
502090134051212150
$ date +%s%9N -r 2.y2k
104915181204630000
4 - Verify functionality of the newly created regular Y2K files
$ y2k .
Hello World!
This would make editing much easier, but also allow exporting for scenarios where proof of a 0-byte solution is needed.
Right now while
loops are terminated using the sequence 1999
, while if
s are terminated using 2000
. Neither is ideal for programs that need to use either of these values (i.e. setting a value to 2000
inside of an if
statement would be problematic), but there has to be a numeric representation of terminating these sections that minimizes overlap with possible program values, while also not requiring a large number of digits to represent.
This might be kinda clunky to implement, but is definitely needed.
One approach could be to specify the size of a float value as length+1, with the last digit used for placement of the decimal. So to store the number 3.14
, you would set variable size to 4
and the last digit would be 1
(decimal after the first digit).
So if the float
variable type was type 4
, the full statement would look like:
Begin creating variable
/ Set Var ID to 1
| / Set var Type to 4 (float)
| | / Set var Size to 4
| | | / Insert 3
| | | | / Insert 1
| | | | | / Insert 4
| | | | | | / Insert 1 (set decimal after first digit)
| | | | | | | /
8 1 4 4 3 1 4 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.