mortoray.com
Leaf | Musing Mortoray
https://mortoray.com/leaf
Programming and Language Design. Leaf is the language we always wanted. Drawing from a half century’s worth of collective knowledge, Leaf incorporates the best ideas into a unified whole. A language with the willingness to rebuild everything and examine the deep foundations of every issue. All programmers will feel at home with Leaf. The code for the project is available on Launchpad. It uses the “scons” build system; refer to the. File for instructions on building and running. Concurrency I’m not ...
mortoray.com
Get rid of those boolean function parameters | Musing Mortoray
https://mortoray.com/2015/06/15/get-rid-of-those-boolean-function-parameters
Programming and Language Design. Get rid of those boolean function parameters. Asymp; 13 Comments. I need to make a quick variation of a function. The calculation, or behaviour, differs slightly on the needs of the caller. I throw in a. Parameter to do this switch. It’s fast and easy, yet I’m almost always disappointed later. It’s a bit hard to read from the call side. An enum, or distinct functions, would be cleaner. The basic example here is you have a function:. When I’ve just modified the. The caller...
mortoray.com
Reusing existing test suites for new features | Musing Mortoray
https://mortoray.com/2015/08/10/reusing-existing-test-suites-for-new-features
Programming and Language Design. Reusing existing test suites for new features. Asymp; Leave a comment. Redundancy is one of the biggest sources of problems on any project, especially in tests. Having an unmaintainable test suite is in nobody’s interest. Eliminating redundant code is one of those things that can trump other design considerations. In the case I’ll describe here I hijacked my an existing test suite to test a new feature. Type conversion is a major part of Leaf. C drop lvalue- c deref.
mortoray.com
Calculating square root using Newton’s iterative method | Musing Mortoray
https://mortoray.com/2015/07/29/calculating-square-root-using-newtons-iterative-method
Programming and Language Design. Calculating square root using Newton’s iterative method. Asymp; 4 Comments. I suddenly had a desire to calculate square roots. It’s been one of those things that just sits at the back of my mind lingering. I knew roughly that an iterative method is probably used, but I finally decided to actually write the code. In this article I do a quick introduction to Newton’s method then show how it is used to find a square root. We can calculate a new value on each iteration:.