Code Monkey home page Code Monkey logo

scatex's Introduction

This package aims to support literate programming in scala.

It can be treated more as an (unscientific) experiment to understand some of the following:
(a) Is literate programming any good?
(b) Is Literate programming really relevant for high level (functional) languages like scala?
(c) Does it provide a better way of opening one's source code - (as opposed to the traditional form of giving away the full source code as is) ?


The pre-zeroth step is to have a simple working tool (ScaTeX) that lets us experiment with this style for some real programs.

ScaTeX, currently, is tightly coupled with  conTeXt (http://wiki.contextgarden.net/)

There are two stand alone programs:

STangle.
It generates one or more source code files from a given literate file. 
To Run, say
scala com.github.lp.STangle [mode] fileName

Each code section will be surrounded with  '\begin{code}' and '\end{code}'.
This should be followed by a file command.
\File{""} (where the path of the target code file is to be given) (No spaces are allowed between any two of 'file','{',string-literal and the '}'.
There can be any number of empty spaces between the '\end{code}' and the file command.

The necessary  parent directories are created.

If the file command is not provided, the code is sent to the previous one.
If there's no file command at all, the output goes to Stangle.out file in the current directory.

This tool takes upto  two command line arguments :-
fileName: mandatory argument containing the literate source code
"mode" : It is optional. mode can be scala or haskell or final. Depending on the mode, it generates the appropriate comments at the end of the line containing
the line numbers of the same code in the literate source file. (This approach makes sense for haskell mode, only when the file command is used)


ScaTeX
This code take the literate source file and 'decorates' the source code as per the keywords and color groups given in a context file.
scala com.github.lp.ScaTeX  [mode] fileName [ContextFile]

mode is currently useless
ContextFile contains directives for syntax coloring
fileName contains the literate source file.

Building the tool:
fsc *.scala


The road map:
* emacs mode
* support to converting directly to postscript 





Next steps:
a. Changing mode of implementation back to haskell.
b. Implementing a new lexer
c. Support for writing or generating API docs
d. Integration with compilers

scatex's People

Contributors

blaisorblade avatar kapilash avatar

Watchers

 avatar  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.