Language Theories

Started by
19 comments, last by mattnewport 17 years, 9 months ago
Hrm does Haskell provide an API for using the interpreter inside another C++ application? If not that is fine, I do like the way that language looks.. its.. different.
"Mommy, where do microprocessors come from?"
Advertisement
Haskell is a multiple implementations language. Most are native code compilers, so they aren't suitable for embedding. Hugs is a bytecode compiler/interpreter written in C. I don't know how easy or hard it is to embed into another application, the website lists no embedding API.
Quote:Original post by Dreq
Hrm does Haskell provide an API for using the interpreter inside another C++ application? If not that is fine, I do like the way that language looks.. its.. different.


Haskell is a language specification, not a particular implementation. AFAIK all the current implementations are compilers, but there might be embeddable interpreters out there. If there is one, it's probably listed at haskell.org I've never heard of one, but I'm more of a ML user myself, and don't know Haskell all that much.

Hope this helps.
Well so long as it gives me enough detail to be able to properly impliment it, I can write my own api (in this situation I might as well make it its own .lib and contribute back to the community or whatnot since everything else is modular also).
"Mommy, where do microprocessors come from?"
There are far too many to mention, but I'll list a few interesting ones. I suggest you don't focus too much on heavily OOP languages.

Haskell, as already mentioned is an important functional language. SML and OCaml aren't as much of a radical departure from C++, but they are easier to pick up and might be a good stepping stone. Just try to learn functional methods of programming, and don't try to use a C++ style in them. OCaml itself is a very nice, practical language which is good for doing the things you'd usually use C++ for.

Oz is a very impressive language with support for many programming paradigms, such as functional, imperative, concurrent, OOP, logic and constraint programming. I highly recommend the book Concepts Techniques and Models of Programming Languages if you can afford it - it uses Oz and teaches all these styles of programming. You'll learn a lot from it.


Other languages that are interesting in some regards:

Erlang is a concurrent functional language now with hardware threads that shows how much easier multithreaded programming can be compared to C++.

E is a functional/OOP language which introduces capability-based security.

Slate is a new Smalltalk-like language with a prototype-based object system and other interesting things. Interesting if you have only ever used class-based OOP.

Epigram is a pure functional language with a dependent type system (not for the faint of heart).
Try taking a look around lambda-the-ultimate.

Quote:
Epigram is a pure functional language with a dependent type system (not for the faint of heart).

You forgot to mention the funky, "2D" syntax.
Quote:Original post by bytecoder
Try taking a look around lambda-the-ultimate.

Quote:
Epigram is a pure functional language with a dependent type system (not for the faint of heart).

You forgot to mention the funky, "2D" syntax.
Yeah, the current editor isn't too helpful with it either. Promising though.

Hows Boa coming along? I'm going to start an interpretter for my language soon.
Quote:Original post by Rebooted
Quote:Original post by bytecoder
Try taking a look around lambda-the-ultimate.

Quote:
Epigram is a pure functional language with a dependent type system (not for the faint of heart).

You forgot to mention the funky, "2D" syntax.
Yeah, the current editor isn't too helpful with it either. Promising though.

Does the editor let you write LaTeX or do you have to do that manually?

Quote:
Hows Boa coming along? I'm going to start an interpretter for my language soon.

Good, I've almost got the type system done. After that I've only got a few relatively simple things left to implement. What language are you going to write your interpreter in?

Quote:Original post by bytecoder
Does the editor let you write LaTeX or do you have to do that manually?
Well, instead of typing the forall symbol, you type all. The 2D brackets take this form:

( !
! )

Quote:
Good, I've almost got the type system done. After that I've only got a few relatively simple things left to implement. What language are you going to write your interpreter in?
I'm going to test out my ideas by writing a dialect of lisp for simplicities sake, and so I don't have to worry about syntax. This will get implemented in Scheme. From there, I'll work out my syntax and write an interpreter for the real language in OCaml. I think I'll be using the lisp version for a while though - there are a lot of things I want to test out, although the type system has been my main focus so far.
Quote:Original post by Dreq
Hrm does Haskell provide an API for using the interpreter inside another C++ application? If not that is fine, I do like the way that language looks.. its.. different.


There is a foreign function interface so you can export Haskell functions for use with any language that can interface through C.

Most people tend to call C from Haskell, though (i.e. write as much as possible in Haskell) so that route is more explored in tutorials and the like (there are even quite a few tools to generate the FFI stubs automatically given header files for C/C++).

This topic is closed to new replies.

Advertisement