Coder Social home page Coder Social logo

micans / zoem Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 453 KB

A macro/programming language with stacks

Home Page: https://micans.org/zoem

License: Other

Makefile 0.31% M4 3.98% Shell 13.51% C 82.20%
macro-processor macro-programming stack-based microlanguage

zoem's Introduction

zoem

A macro/programming language with stacks

It looks like this:

\def{fib#1}{
   \push{fibonacci}
   \set{a}{1}
   \set{b}{1}
   \set{c}{0}
   \while{\let{\a <= \1}}{
      \setx{c}{\a}
      \setx{a}{\let{\a + \b}}
      \write{-}{txt}{\c\|}
      \setx{b}{\c}
   }
   \pop{fibonacci}
}

\: need to escape newlines below, lest they ruin the prompt

\write{-}{device}{Enter a number please, then press , \@{\N>\s}}\
\setx{num}{\zinsert{-}}\
\fib{\num}

Zoem has stacks, arithmetic environment, delayed evaluation, inside-out evaluation, and a lot more features to allow abstraction, encapsulation and (lexical) scoping, as well as syntactic sugar to facilitate HTML production.

Built deeply into the zoem language is that it allows distinction between two types of scope; plain scope where text/output is assumed to carry meaning, and device scope, where text/output is assumed to be mark-up. Different filtering mechanisms exist for the two scopes. This facilitates the creation of compact DSL languages that support completely different output formats (e.g. HTML and nroff), such as Portable Unix Documentation.

For more information visit Zoem's homepage.

zoem's People

Contributors

micans avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zoem's Issues

Program segfaults under Arch Linux

zoem -h does not, but zoem without parameters segfaults.

(gdb) file /usr/bin/zoem
Reading symbols from /usr/bin/zoem...
(No debugging symbols found in /usr/bin/zoem)
(gdb) run
Starting program: /usr/bin/zoem
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d0cbca in ?? () from /usr/lib/libc.so.6

warning: adding 'int' to a string does not append to the string

On my macOS 10.15.7 system the clang compiler showed this warning when compiling zoem 21-341:

ops.c:853:60: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
      ;  mcxTingNAppend(data, "_abcdefghijklmnopqrstuvwxyz"+r, 1)
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
ops.c:853:60: note: use array indexing to silence this warning
      ;  mcxTingNAppend(data, "_abcdefghijklmnopqrstuvwxyz"+r, 1)
                                                           ^
                              &                            [ ]
1 warning generated.

Better document and verify the cimfomfa requirement

zoem 21-341 fails to build with many errors like this if cimfomfa is not installed:

In file included from ops-xtag.c:9:
In file included from ./ops-xtag.h:12:
./segment.h:12:10: fatal error: 'tingea/ting.h' file not found
#include "tingea/ting.h"
         ^~~~~~~~~~~~~~~

After installing cimfomfa 21-361 these problems go away.

Perhaps the zoem configure script could exit with a helpful error message if cimfomfa is not installed?

The ChangeLog says "Compiling zoem now requires installation of cimfomfa" but a person trying to install the software is unlikely to begin by reading the ChangeLog. They are more likely to read the README file, which refers users to the INSTALL file, but neither of these files mention the cimfomfa requirement. Perhaps one or both of those files could mention it?

document or tighten let integer overflow

\let{2**63}
\let{2**63-1}
\let{2**62+2**62+1}
.
<-------------- zoem -------------->
-9223372036854775808
9223372036854775807
-9223372036854775807

Underneath this is undefined behaviour at the C level.

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.