288 reputation
311
bio website
location
age
visits member for 2 years, 5 months
seen Dec 10 at 0:08

I'm the author of a natural language programming system called EngScript.

Some of my favorite software projects are:

I have written some useful macros in sweet.js:

//for repeating if statements
macro ifs{
    rule{
        {$($x {$y...}) ...}
    } => {

        $(if($x){
            $y...
        }) ...
    }
}

//a concise way to define several different functions
macro manyFuncs{
    rule{{$($x ($y...) {$z...}) ...}
    } => {
        $(function $x($y...){
            $z...
        }) ...
    }
}

ifs {
    a{
        b
    }
    c{
        d
    }
}

manyFuncs{
    fullName(firstName, lastName) {
        return firstName + lastName;
    }
    squared(a){
        return a*a;
    }
}

Right now, I'm searching for a parser that can handle ambiguous grammars.

In theory, it would also be possible to create a very concise programming language with implicitly defined parameters:

isDivisibleBy: (foo % bar) == 0
//This is a function with 2 parameters: foo and bar.

isEven: isDivisibleBy(foo, 2)

isOdd: !isEven(param1)

firstCharacter: theString[0]

lastCharacter: theString[theString.length - 1]

firstNCharacters: theString[0:end]

firstCharacterIsLastCharacter: firstCharacter(stringParameter) == lastCharacter(stringParameter)

printEach: for current in anArray{ print current }

http://rosettacode.org/ is one of the most comprehensive programming language references I've ever found.

Optionally-typed programming languages are really awesome: they combine the type safety of languages like Java with the conciseness of languages like Python.

Some cool things that I've made:

Someday, I hope it will be possible to create a programming language that mixes code from different languages into a single file, like this:

Python {
    def foo():
        return "foo"
}
Ruby {
    def bar
        return foo + " was called from Python."
    end
}

Jul
27
comment How can I write a set of functions that can be invoked from (almost) any programming language?
Which scripting language and/or programming language would you recommend for the purpose of creating a command line foreign function interface? Also, have you found any concrete examples of such interfaces?
Jul
26
comment How can I write a set of functions that can be invoked from (almost) any programming language?
Can you explain what you mean by a "non-computer language method?"
Jul
26
comment Sharing API's between different Programming languages?
This topic may be relevant: programmers.stackexchange.com/questions/157536/…
Jul
25
comment How can I write a set of functions that can be invoked from (almost) any programming language?
Would the dll (dynamically linked library) be compatible any platform besides Windows? I need cross-platform compatibility here.
Jul
22
comment How can I write a set of functions that can be invoked from (almost) any programming language?
Should I just write 3 separate RESTful APIs for each of the languages?
Jul
22
comment How can I write a set of functions that can be invoked from (almost) any programming language?
So what steps would I need to take if I wanted to write the API in multiple languages as well? (In my case, those languages would be Javascript, C++, and Java.)
Jul
20
comment How can I write a set of functions that can be invoked from (almost) any programming language?
What kind of HTTP interface do you have in mind, specifically?
Jul
20
comment How can I write a set of functions that can be invoked from (almost) any programming language?
I am not trying to exclude any specific language, but I wasn't sure if it was possible to write an API in one programming language that could be accessed from any other language. I want to write a cross-language API that is accessible to as many languages as possible, because I want to avoid the hassle of re-writing the entire API whenever I switch from one language to another.