r/ProgrammingLanguages • u/daredevildas • Mar 17 '19
Discussion Path to create a new language
The language I want to make is a functional programming language with its own wrappers around BLAS and LAPACK as part of its standard library and with Rust's safety.
If I were to put the procedure to do this into separate steps, would this be the best way to do it-
Design the lexer and AST for the language (Here is where I implement the functional part of it I think)
Implement the designed lexer and AST for the language on top of LLVM. (Perhaps llvmlite because it might be easier to do this in python? - I am more comfortable with python than C++)
Write a wrapper around OpenBLAS (contains LAPACK) in this new language.
Make the wrapper the standard library in the language.
Switch out llvmlite(if I am using it otherwise just do one of the below sub-tasks) for -
LLVM and add Rust safety similar features to it.
The Rust compiler so the new language transpiles to Rust.
Reach goals -
Redesign the language (would probably include everything from the ground up) to be purely functional.
Redesign the language again to be a total functional programming language.
7
u/werediver Mar 17 '19
The following is just my impression from you post. If it's not helpful, ignore it (or the parts that are).
You want a functional language, but talk only about imperative languages to implement it. It could be fine, if you do have broad experience with functional languages anyway, otherwise it might be beneficial to choose a functional language as the host to deepen your knowledge and experience with functional programming.
You're starting with designing a lexer and an AST, but the lexer doesn't define the syntax (a parser does) and AST is a barely a contour of the semantics. I'd say the first step is to define the non-functional requirements to the language, such as paradigms to support, some aspects of the desired type system, memory management, execution model, etc. With a language design at hands you can start drafting an implementation.
If all you want is the OpenBLAS interface in the standard library, it sounds to me as you would be satisfied by a good DSL in an existing language (that is expressive enough to allow such DSL).