The Frink programming language
ncreep.github.io
The Frink programming language
1–10 of 12 posts
Re: The Frink programming language
#2Re: The Frink programming language
#3Re: The Frink programming language
#4Re: The Frink programming language
#5Neat idea. I generally just use Wolfram|Alpha for these types of calculations, but Frink seems more programmable and doesn't require an Internet connection.
(And I think it's from a dozen years ago, W|A was still a dream at the time :) )
Re: The Frink programming language
#6Re: The Frink programming language
#7This seems to be an arbitrary collection of typedefs and consts. I mean look at the definition of 'moondist'. This is a single value and is measured from where? I mean the distance from earth to moon is somewhat static but what about the distance from Venus to the moon.
And yes, it's a big ad hoc bag of hopefully-useful values. It turns out that a big ad hoc bag of hopefully-useful values is, in fact, sometimes useful.
(Of course there's more to Frink than its big bag of handy predefined values. But I take it it's only the big bag of handy predefined values you're criticizing, and indeed that is one of the more interesting features of Frink.)
Re: The Frink programming language
#8Re: The Frink programming language
#9Re: The Frink programming language
#10A similar thing can be done with dependent types: https://github.com/timjb/quantities
I was bored the other day and put up some old C++ code. [1] Some years ago I was playing around with C++ templates (pre C++11) to see how far I can go and I came up with exactly that kind of unit checking and conversion. The trickiest part was eliminating common terms when dividing units but once you figure out how to approach it, it's not that hard. Complete unit inference is definitely possible and maybe even worthwhile depending on your use case.
That said, it is still just some experimentation, but maybe someone feels inspired :)
[1] https://github.com/jpommerening/template-hell.git (Note: don't expect proper documentation yet, I'm still figuring out how to structure namespaces there, etc.)
Edit: I remember the over-the-top template substitutions made XCode 3 crash back in the day. You have been warned.