Coder Social home page Coder Social logo

theswanfactory / hclang Goto Github PK

View Code? Open in Web Editor NEW
4.0 9.0 0.0 2.7 MB

Homoiconic C - a universal data format for computation

Home Page: https://theswanfactory.wordpress.com/2016/12/20/homoiconic-c-a-universal-language-for-code-and-data/

License: MIT License

JavaScript 1.01% TypeScript 65.19% HolyC 33.80%
html markup-language maml programming-language homoiconic systems-language

hclang's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hclang's Issues

Update README

Talks about Atom and Chrome debugger"?

Also, we no longer use Code Ship

Should link to any readable documentation...

support blobs

Right now we skip all bit manipulation specs

test/execute/execute-spec.ts:    it.skip('joins blobs', () => {
test/frames/frame-blob-spec.ts:  it.skip('appends blobs on a common base', () => {
test/frames/frame-blob-spec.ts:  it.skip('append tracks length properly', () => {

Bit Manipulation

These don't seem to work.

$-.test-fail ““[0b101, 0b010] .& AppendZero” ?“[0b1010, 0b0100]” !“[0b1000, 0b1000]””;“{"total":20,"pass":17,"fail":3}”;
$-.test-fail ““[0b101, 0b010] .| AppendZero” ?“0b10100100” !“0b10000010””;“{"total":21,"pass":17,"fail":4}”;
$-.test-fail ““BitSplitter3 0b10101100” ?“[.head 0b101; .tail 0b01100;]” !“<[(head); (tail);], 0b10101100>””;“{"total":26,"pass":18,"fail":8}”;

Use native JavaScript objects

Work directly with prototype to manage Frames. I have no idea how, but it does feel like we ought to be able to implement the Frame runtime without having to use TypeScript class wrappers. This could make things much easier when we get around to doing a Transpiler.

The most likely "gotcha" will be the fact that JavaScript does not treat Strings and Arrays as Objects, but we might be able to fix that with properties...

Extract meta

Circular declarations are allowed.

Frame inherits from Meta
Meta returns Frames

script spec

Pass script spec

Does the CLI even work?
Does it run with ts-node vs node?
Can we install?

Is there a better framework for testing it?

pass bitscheme

npm run bs

$-.test-fail ““`Hello`` World`” ?“`Hello World`” !““Hello World”””;“{"total":7,"pass":6,"fail":1}”;
$-.test-fail ““the-answer” ?“42” !“$!.name-missing “$:HCTest.113.the-answer”;””;“{"total":8,"pass":6,"fail":2}”;
$-.test-fail ““ther-answer” ?“$ther-answer” !“$!.name-missing “$:HCTest.113.ther-answer”;””;“{"total":9,"pass":6,"fail":3}”;

Refactor isNil/isVoid

Should not need both. Perhaps isNil overrides the callers, so we can get rid of the isVoid checks

Support Types

$-.test-fail ““enum123.<>” ?“<1,2,3>” !“$!.name-missing “$:FrameNumber.1909.”; .++ [<>];””;“{"total":23,"pass":18,"fail":5}”;
$-.test-fail ““@enum123 4” ?“$@enum123<1,2,3> 4” !“enum123””;“{"total":24,"pass":18,"fail":6}”;
$-.test-fail ““<.x, .z> [.x 1; .y 2; .z 3;] # Selector” ?“[1, 3]” !“<x, z, [(x); (y); (z);]>””;“{"total":25,"pass":18,"fail":7}”;

pass testdocs

$-.test-fail “() +“2” -()”;“{"total":33,"pass":11,"fail":22}”;
$-.test-fail “() +“7” -()”;“{"total":13,"pass":7,"fail":6}”;
$-.test-fail “() +“[.head 0b101; .tail 0b01100;]” -()”;“{"total":38,"pass":11,"fail":27}”;
$-.test-fail “() +“{0b1 0b0}” -()”;“{"total":21,"pass":10,"fail":11}”;
$-.test-fail ““#  inline comment # 4321” +() -“1234””;“{"total":6,"pass":5,"fail":1}”;
$-.test-fail ““.Bit <0b0, 0b1>;” +() -“(Bit)””;“{"total":19,"pass":10,"fail":9}”;
$-.test-fail ““.BitStream <[@Bit]>; # Variable-length Sequence of a specific type” +() -“(enum123)””;“{"total":30,"pass":11,"fail":19}”;
$-.test-fail ““.Byte <8@Bit>; # Fixed-length sequences” +() -“(Byte)””;“{"total":31,"pass":11,"fail":20}”;
$-.test-fail ““.false ()” +() -“false””;“{"total":24,"pass":11,"fail":13}”;
$-.test-fail ““.the-answer 42;” +() -“(the-answer)””;“{"total":9,"pass":6,"fail":3}”;
$-.test-fail ““.true <>” +() -“true””;“{"total":25,"pass":11,"fail":14}”;
$-.test-fail ““<.x, .z> [.x 1; .y 2; .z 3;] # Selector” +“[1, 3]” -“<x, z, [(x); (y); (z);]>””;“{"total":36,"pass":11,"fail":25}”;
$-.test-fail ““@enum123 4” +“$@enum123<1,2,3> 4” -“enum123””;“{"total":35,"pass":11,"fail":24}”;
$-.test-fail ““AppendZero” +() -“(AppendZero)””;“{"total":20,"pass":10,"fail":10}”;
$-.test-fail ““BitSplitter3 0b10101100” +() -“(BitSplitter3)””;“{"total":37,"pass":11,"fail":26}”;
$-.test-fail ““[.a 1; .b 2;].a” +“1” -“$!.name-missing “$:FrameArray.1164.a”;””;“{"total":23,"pass":11,"fail":12}”;
$-.test-fail ““[0b101, 0b010] .& AppendZero” +“[0b1010, 0b0100]” -“[0b1000, 0b1000]””;“{"total":28,"pass":11,"fail":17}”;
$-.test-fail ““[0b101, 0b010] .| AppendZero” +“0b10100100” -“0b10000010””;“{"total":29,"pass":11,"fail":18}”;
$-.test-fail ““`Expression1`,`Expression2`” +“`Expression1`,`Expression2`” -“(`Expression1`, `Expression2`)””;“{"total":15,"pass":8,"fail":7}”;
$-.test-fail ““`Hello`` World`” +“`Hello World`” -““Hello World”””;“{"total":8,"pass":6,"fail":2}”;
$-.test-fail ““`Statement`;” +() -“(`Statement`)””;“{"total":16,"pass":8,"fail":8}”;
$-.test-fail ““enum123.<>” +“<1,2,3>” -“$!.name-missing “$:FrameNumber.1652.”; .++ [<>];””;“{"total":34,"pass":11,"fail":23}”;
$-.test-fail ““enum123” +() -“(enum123)””;“{"total":32,"pass":11,"fail":21}”;
$-.test-fail ““false .? `Yes` .: `No`” +“`No`” -“$!.name-missing “$:HCTest.117.false”; .++ [?, `Yes`, :, `No`];””;“{"total":27,"pass":11,"fail":16}”;
$-.test-fail ““the-answer” +() -“(the-answer)””;“{"total":12,"pass":7,"fail":5}”;
$-.test-fail ““ther-answer” +“$ther-answer” -“$!.name-missing “$:HCTest.117.ther-answer”;””;“{"total":11,"pass":7,"fail":4}”;
$-.test-fail ““true .? `Yes` .: `No`” +“`Yes`” -“()””;“{"total":26,"pass":11,"fail":15}”;

testdocs

$ npm run testdoc
# $-.test-fail ““123” +“456” -“123””; .n “{"total":1,"pass":0,"fail":1}”;
# $-.test-fail ““#  inline comment # 4321” +() -“1234””; .n “{"total":2,"pass":0,"fail":2}”;
# $+.test-pass ““789” +“789””; .n “{"total":3,"pass":1,"fail":2}”;
# $+.test-pass ““0xabc” +“0xabc””; .n “{"total":4,"pass":2,"fail":2}”;

`npm run testdoc` pauses

When I run a test doc test, it unexpectedly pauses at the end.
I have to hit enter before my prompt returns.

if I have an echo at the end, that doesn't show until afterwards.

Is it somehow waiting for input?!?

RunDoc

-r

Takes a Markdown or AsciiDoc file argument
(Perhaps automatically)
Prepends the triple-quote
And runs testdoc

experimental-loader to register

I just started getting a new version of this error all the time when I run mocha with TypeScript using ESM modules.
Possibly due to using the latest node/npm.

Anyone else seeing this?

(node:38547) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--
import 'data:text/javascript,
  import { register } from "node:module"; 
  import { pathToFileURL } from "node:url"; 
  register("ts-node/esm", pathToFileURL("./"));
'
--
(Use `node --trace-warnings ...` to show where the warning was created)

pop.mismatched-brackets

.hc 0.5.3;
; <>
pop.mismatched-brackets
# <>
; {}
pop.mismatched-brackets
# {}
; []
pop.mismatched-brackets
# []
; () # no error

Bind using spaces

Track number of spaces, and use that to infer grouping

Space plays an important role in binding, since we do not allow implicit
precedence. Spaces create a new subexpression, so frames that have no
space between them bind more tightly than those that do.

Catch exceptions

Sometimes we expect a test to fail.
How do we testdoc that it correctly failed?

$+.test-pass ““the-answer” ?“42””;“{"total":8,"pass":7,"fail":1}”;
$-.test-fail ““ther-answer” ?“$ther-answer” !“$!.name-missing “$:HCTest.111.ther-answer”;””;“{"total":9,"pass":7,"fail":2}”;

BitScheme: Symbolicate Output

Pipe types into (inverse) mapping to render as symbols.

Suggestion: do not change the data storage. Use the type to instead modify the output.

Support Conditionals

'?' and ':' do not appear to do anything.

$-.test-fail ““true .? `Yes` .: `No`” ?“`Yes`” !“()””;“{"total":18,"pass":17,"fail":1}”;
$-.test-fail ““false .? `Yes` .: `No`” ?“`No`” !“$!.name-missing “$:HCTest.113.false”; .++ [?, `Yes`, :, `No`];””;“{"total":19,"pass":17,"fail":2}”;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.