Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Frink programming language (futureboy.us)
27 points by fogus on July 23, 2010 | hide | past | favorite | 10 comments


I've looked at the doco, but I can't seem to find a way to declare a new glaven, even in jest. That should be a central feature in a language named Frink, shouldn't it?


If a glaven is a new type of unit not related to any of the ordinary metric units, you can add it thusly:

glaven =!= awesomeness

Which makes it the fundamental unit of awesomeness. Then you can write things like

100 kiloglaven / second

to express the rate of increase of your awesomeness.


I looked at the examples and they look awesome. One thing I didn't get, though: How will you keep in mind the various units etc? For example, it's great that Frink has the "beerbarrel" unit, but how would you know of this a priori if you have not used it before. There must be powerful search and/or completion mechanisms in the IDE to be able to use this effectively it seems.


You can look up units or functions in Frink by just typing part of the name preceded by a question mark, or 2 question marks for more verbose output. For example,

?saturn

or

??saturn

will list the units that contain that substring. (The second example lists the units AND their values.) Typing

?barrel -> gallons

will list all the barrel sizes it knows and their volume in gallons. Cool!


Well that's one reason i originally started the project that i've been working on, Farnsworth. It was originally a direct clone of Frink but I have since decided that i want to take it in a different direction (in syntax and design). It's currently at the prototyping stage and is likely to change drastically (i have LOTS of drastic plans for it). I'm currently working on documentation and tests for the prototype so that i can understand what i broke and when. you can read more about the project at http://simcop2387.info/ The prototype is currently resource hungry and written in perl, but desgined for me to be easy to hack and change on so i can replace parts of it as i decide i don't like them.


Oh, how convenient; I don't have to worry about putting this in Perl. Be sure to update to CPAN!


Does this offer anything that Wolfram Alpha doesn't?

http://www.wolframalpha.com/input/?i=how+many+calories+in+a+...


Yeah, Frink is a Turing-complete programming language. That's a provably huge difference. You can have loops, maintain state, store results in variables and use them later, and define your own functions, so your calculations are repeatable and can be more than one line. Can't do those things with Wolfram Alpha. Frink has an unambiguous, documented syntax, rather than a bunch of tricky and finicky hard-coded rules that try to parse English sentences.


You own the output of your calculations, not Wolfram?


Frink is a general purpose language, not just a unit conversion tool.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: