Discussion:
developing C via FP?
(too old to reply)
raould
2010-02-17 22:40:48 UTC
Permalink
hypothetically speaking, say i wanted to build my own C/++ library for
garbage collection (e.g. a la Bohem) but didn't want to write it in C/+
+, rather a nice FP that would generate nice C/++ for me. i want the
generated code to be tight, and not to have to pull in some megabytes
of stdlib -- i'm thinking of targeting embedded systems. any thoughts
on what languages would be most applicable?

thanks.
Paul Rubin
2010-02-18 04:30:13 UTC
Permalink
Post by raould
hypothetically speaking, say i wanted to build my own C/++ library for
garbage collection (e.g. a la Bohem) but didn't want to write it in C/+
+, rather a nice FP that would generate nice C/++ for me. i want the
generated code to be tight, and not to have to pull in some megabytes
of stdlib -- i'm thinking of targeting embedded systems. any thoughts
on what languages would be most applicable?
I've been fooling with Atom, an embedded DSL that generates C code:

http://hackage.haskell.org/package/atom

It's for hard real time applications, and you really pay for that
stylistically. If you just want to compile a functional language to C
without a big runtime, then that's how JHC works. ATS
(www.ats-lang.org) also generates code that way.
raould
2010-02-18 19:20:32 UTC
Permalink
 http://hackage.haskell.org/package/atom
woah, that certainly sounds neat, thanks!
without a big runtime, then that's how JHC works.  ATS
(www.ats-lang.org) also generates code that way.
jhc is interesting, and makes me re-look-up how haskell in general is
doing on the iphone :-)
http://www.haskell.org/haskellwiki/IPhone

i'm aware of ats because of the dependent typing abilities, but i
really haven't looked at it at all.

thanks.

Jon Harrop
2010-02-18 09:33:22 UTC
Permalink
Post by raould
hypothetically speaking, say i wanted to build my own C/++ library for
garbage collection (e.g. a la Bohem) but didn't want to write it in C/+
+, rather a nice FP that would generate nice C/++ for me. i want the
generated code to be tight, and not to have to pull in some megabytes
of stdlib -- i'm thinking of targeting embedded systems. any thoughts
on what languages would be most applicable?
You might look at John Skaller's Felix language but I'm not familiar with
it.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
raould
2010-02-18 19:17:37 UTC
Permalink
Post by Jon Harrop
You might look at John Skaller's Felix language but I'm not familiar with
it.
yeah, i sure hope Felix becomes more real in the future, no offense to
the project :-)
Rod Pemberton
2010-02-18 10:08:34 UTC
Permalink
Post by raould
hypothetically speaking, say i wanted to build my own C/++ library for
garbage collection (e.g. a la Bohem) but didn't want to write it in C/+
+, rather a nice FP that would generate nice C/++ for me.
You understand that will require two compilers, yes? One to compile and
test the FP code and one to compile and test the C/++. I'd guess it'd be
much easier to maintain the library if only a single language is involved.
Of course, you'd then need another package to convert or translate to C/++.
Post by raould
i want the generated code to be tight,
and not to have to pull in some megabytes
of stdlib -- i'm thinking of targeting embedded
systems. any thoughts on what languages
would be most applicable?
Only what is commonly used: assembly, FORTH, and C. Oh, you meant FP
language's... Sorry.

Ok, what am I doing sub'd to comp.lang.functional?... Sigh, I think this
one is getting dropped.


Rod Pemberton
Loading...