c3d / xl

A minimalist, general-purpose programming language based on meta-programming and parse tree rewrites
GNU General Public License v3.0
270 stars 15 forks source link

Binary node in the parse tree #26

Open c3d opened 4 years ago

c3d commented 4 years ago

It might be interesting to have a binary tree to hold arbitrary (possibly typed) binary data in the parse tree. This could also be represented as a very large integer, which could use the base-16 or base-64 notation.

Example:

some_data is bits 16#FFFF_FFFE_FFFD_FFFC_FFFB__FFFA_FFF9_FFF8_FFF7_FFF6_FFF5_FFF4_FFF3_FFF2_FFF1_FFF0

Currently, the above does not work because the integer value is too big. There is probably a need for specific prefixes (e.g. bits above), which could also serve as an elementary type for the value.

This could be implemented through issue #27.