285 reputation
311
bio website
location
age
visits member for 2 years, 3 months
seen Oct 16 at 1:14

I'm the author of a natural language programming tool called EngScript, which automatically translates English sentences into Python source code.

For reference, I've posted a link to questions with tags that I'm interested in.

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
}

Mar
18
asked Writing an API that is syntactically valid in multiple programming languages
Feb
25
awarded  Caucus
Dec
13
comment How can I write a set of functions that can be invoked from (almost) any programming language?
In order to use a command-line interface in this way, would you get the console output for a specific command (such as whoami on Ubuntu to get the username), or did you have something else in mind?
Nov
23
comment How can I write a set of functions that can be invoked from (almost) any programming language?
I recently found a programming language called Haxe- it can be compiled to many different programming language, and appears to be extremely well suited to this purpose.
Nov
6
answered Why aren't there automated translators from one programming language to another?
Oct
20
comment Is javascript worth learning if you do not plan on being a web developer?
@VitorBraga I think developing applications with node.js would be one good option - it has a comprehensive set of libraries that are useful for general-purpose scripting tasks such as image editing and file reading/writing.
Oct
20
comment Is javascript worth learning if you do not plan on being a web developer?
@dkuntz2 Javascript isn't just good for "web stuff" - I use node.js as a general purpose scripting tool, and for developing desktop applications.
Sep
3
comment How can I write a set of functions that can be invoked from (almost) any programming language?
How can foreign function calls be done using Apache Thrift?
Sep
3
accepted Is it possible to call a Javascript function from C?
Aug
2
comment Is it possible to call a Javascript function from C?
I'm trying to make the Javascript API accessible from as many programming languages as possible for the purpose of code reuse. One method of doing this is by writing a C API, as described here: programmers.stackexchange.com/a/157605/57752
Aug
2
comment Is it possible to call a Javascript function from C?
Also, I'd like it to be cross-platform.
Aug
2
comment Is it possible to call a Javascript function from C?
I'm aiming for code reuse, not browser automation.
Aug
2
comment Is it possible to call a Javascript function from C?
There are a few Javascript-to-C++ bindings available, but I need my Javascript functions to be invoked from C, not C++.
Aug
2
asked Is it possible to call a Javascript function from C?
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
awarded  Critic
Jul
26
comment Sharing API's between different Programming languages?
This topic may be relevant: programmers.stackexchange.com/questions/157536/…
Jul
25
awarded  Commentator
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.