Live data from Hacker News

The Frink programming language

ncreep.github.io

1–10 of 12 posts

Re: The Frink programming language

#3
This 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.

Re: The Frink programming language

#5
post #2

Neat idea. I generally just use Wolfram|Alpha for these types of calculations, but Frink seems more programmable and doesn't require an Internet connection.

it also interface with java code easily, providing a simple interface if needed.

(And I think it's from a dozen years ago, W|A was still a dream at the time :) )

Re: The Frink programming language

#7
post #3

This 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.

It's the distance from the earth to the moon, obviously. Why would it be anything else? Why would you care about the distance from anything else 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

#10

A similar thing can be done with dependent types: https://github.com/timjb/quantities

It's funny this is coming up today.

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.

Post reply on HN