Git Product home page Git Product logo

njaml's Introduction

Not just a markup language

About

Njaml (pronounced en-jamol, rhymes with camel and yaml) is a function piping tool that can be implemented for any programming language. It is based on the easy to read and easy to create yaml structure.

Why?

This is yet another attempt at a programming framework that is easy to use, easy to skim, easy to verify, and easier to develop software solutions.

Like YAML, it is hierarchical. In a viewer with collapsing enabled, it is easy to see everything at a high level with the ability to expand sections for as much detail as we want to see.

Can also be useful for debugging, can write the output of each subfunction one by one to a file as a function is ran to see how each step transforms some input.

Suggested workflow

  1. Frame problem as desired input and output
  2. Write a short sequence of high-level abstract tasks that would transform the input to output
  3. Repeat these 2 steps for each abstract task
  4. When a simple implementation is available or a more algorithm heavy section occurs, write an implementation of the task in a executable language.
  5. Write the tasks to an .njaml file
  6. Load the function structure
  7. Link the abstract function name to it's executable language implementation where needed
  8. Add test cases
  9. Run any function at any level to get results.

Example

file.njaml

outer1
  inner11
    inner111
  inner12
outer2
  inner21

example.py

njaml = Njaml()

#Load njaml functions
njaml.load("file.njaml")

njaml.link('inner11',lambda x: x + 2)
njaml.link('inner111',lambda x: x * 2)
njaml.link('inner12',lambda x: x + 2)

njaml.run('outer1',2) # = 10

njaml.run('inner11',2) # = 8

#Add test cases
njaml.set_cases('outer1',[2,3],[10,12])

#run test cases
njaml.run_cases("outer1") # In console: Case 0 passed\n  Case 1 passed\n 2 passed.\n 0 failed.

njaml's People

Contributors

joesuph avatar

Stargazers

Hadj H. avatar

Watchers

James Cloos avatar  avatar

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.