Skip to content

Latest commit

 

History

History
281 lines (177 loc) · 5.7 KB

changelog.org

File metadata and controls

281 lines (177 loc) · 5.7 KB

Changelog for the Fif Scripting Language

1 1.4.0

  • Added $ operator, which destructures a s-exp at the top of the stack into the forth equivalent

    ex.

    ;; Traditional Forth Expression to add two numbers
    2 2 + . ;; 4
    
    ;; $-Expression alternative
    (+ 2 2) $ . ;; 4
    
        

    This should add a certain level of familiarity, with a nested word operator being something that might be added in the future for collections of s-expressions.

    More advanced examples

    (reduce *+ (range 1 10)$)$ . ;; 45
    
        

    The new word function is actually pretty easy to implement yourself while in fif:

    fn $ [coll] &
      coll rest apply coll first apply
    endfn
    
    (+ 2 2) $ . ;; 4
    
        
    • Added documentation strings and appropriate groups to any unassigned or undocumented stdlib word functions to display better in fifiql.

2 1.3.2

  • Fixed error handling checks to be more resilient to non-collections

3 1.3.1

  • Added list-words word function to return a list all words and their metadata that exist within the given stack machine.

4 1.3.0

  • Improved the realizer ?
    • Non-collection values pass through without error
    • Bug Fix: Symbols containing a collection are now correctly evaluated
  • Added new operator, the multi-realizer ??, which is a catch-all realizer for collections containing nested collections. This removes the need to chain the realizer to realize inner collections.

    ex.

    fn name
      *first-name <> setl
      *last-name <> setl
      {:first-name first-name :last-name last-name} ?
    endfn
    
    ;;
    ;; before
    ;;
    
    [{:user-data ("Ben" "Zap" name)
      :email "[email protected]"} ?
      
     {:user-data ("John" "Doe" name)
      :email "[email protected]"} ?] ?
    
    ;;
    ;; after
    ;;
    
    [{:user-data ("Ben" "Zap" name)
      :email "[email protected]"}
      
     {:user-data ("John" "Doe" name)
      :email "[email protected]"}] ??
    
        
    • Added a new destructuring operator ‘&’, which creates local variables from a supplied vector of parameters, and arguments which reside on the stack

      ex.

      1 2 3 [a b c] &
      
      a b c ;; '(1 2 3)
      
              

      This can be used in tandem with a function to assign stack values to parameters in a much clearer way.

      ex.

           ;;
           ;; before
           ;;
      
           fn name
      	*first-name <> setl
      	*last-name <> setl
      	{:first-name first-name :last-name last-name} ?
           endfn
      
           ;;
           ;; after
           ;;
      
           fn name [first-name last-name] &
      	{:first-name first-name :last-name last-name} ?
           endfn
      
              

5 1.2.0

  • Added coercion word functions int, float, boolean
    • Clojure only: char, rationalize, numerator, denominator
  • Added math word functions PI, E, acos, asin, atan, atan2, cbrt, ceil, cos, cosh, exp, floor, log, pow, round, sin, sinh, sqrt, tan, tanh

6 1.1.0

  • The realizer has been updated to work with maps.

    Examples

    def a 10
    def b 12
    
    {:a a :b b} ? . ;; {:a 10 :b 12}
    
        

    As you can see, symbols are realized. Note that lists are realized as well, while other collection types are ignored

    More Advanced Examples

    {:a (2 2 +)} ? . ;; {:a 4}
    
    {:a (2 2 2 +)} ? . ;; {:a (2 4)}
    
    {:a [2 2 +]} ? . ;; {:a [2 2 +]}
    
    {:a ([2 2 +] ?)} ? . ;; {:a [4]}
    
        

7 1.0.4

  • Added piecewise word functions, %, %1, %2, and %3
    • These word functions allow you to dereference word variables that have been placed on the stack ex.
      def x 2
      
      *x 2 + . ;; Error, x has to be dereferenced
      
              

      The fix

      def x 2
      
      *x % 2 + . ;; *x is placed back on the code queue and dereferenced
      
      ;; alternatives
      
      *x %1 2 + .
      
      *x 2 %2 + .
      
              

      It can also be used to reorganize values on the stack

      a b c %3 .s ;; <3> (b c a)
      
      a b c %2 %3 .s ;; <3> (c b a)
      
              
    • How is this different from over and other such stack modication functions?

      The difference is that it is placed back on the code queue for re-evaluation, so it can make for some interesting dereferencing techniques that weren’t possible before.

      example:

      doc assocv "( w k v -- 'w ) Associate key-value pair into word variable"
      fn assocv
        *v <> setl
        *k <> setl
      
        dup % k v assoc setg
      endfn
      
      def x {:a 1 :b 2}
      *x :c 3 assocv
      
      x . ;; {:a 1 :b 2 :c 3}
      
              

8 1.0.3

  • Added symbol word function
  • Added pprint word function

9 1.0.2c

  • Fixed clojar deployment

10 1.0.2b

  • Hot-Fixed clj build of fif

11 1.0.2a

  • Hot-Fixed cljs build of fif

12 1.0.2

  • Improved commandline with evaluation and repl support

13 1.0.1

  • Minor documentation grammar fixes for display word operations
  • fif can now be compiled into a native executable using GraalVM’s native-image. Please refer to the readme.
  • Introduced new word definitions for the commandline version of fif slurp, spit, spita, read-file, and load-file.

14 1.0.0

  • First Production Release, and the start of changelog recordings.