Coder Social home page Coder Social logo

nibbles's Introduction

Nibbles is a code golf language for mortals (it aims to be good at code golf while remaining relatively simple). It is also purely functional, statically typed, and fully lazy. Syntax is Polish (prefix) notation. Each instruction is half a byte when automatically converted from ascii to the binary form.

See golfscript.com/nibbles for tutorials and references.

nibbles's People

Contributors

darrenks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nibbles's Issues

nibbles: failed to compile hs (zip by scalar)

Nibbles code:

! ,4 0 ~ 1

Produces the following error message:

out.hs:192:824: error:
    • Couldn't match type ‘Integer’ with ‘[t0]’
      Expected type: [Integer] -> Integer -> [Integer]
        Actual type: [Integer] -> [t0] -> [Integer]
    • In the third argument of ‘\ a b f -> f a b’, namely
        ‘(((zipWith . \ f a b -> f $ (\ (~a1, ~a2) -> ((a1, a2))) (a, b))
             (\ (arg2t1, arg2t2)
                -> (((((id) (((1)) :: Integer))) :: Integer)))))’
      In the first argument of ‘id
                                . ((\ a b -> intercalate a $ map (sToA . show . confirmInt) b)
                                     secondSep)’, namely
        ‘((((\ a b f -> f a b)
              ((((\ x -> [1 .. x]) ((((id) (((4)) :: Integer))) :: Integer))) ::
                 [Integer]))
             (((\ f -> f (()))
                 (\ (arg2t1) -> (((((id) (((0)) :: Integer))) :: Integer))))))
            (((zipWith . \ f a b -> f $ (\ (~a1, ~a2) -> ((a1, a2))) (a, b))
                (\ (arg2t1, arg2t2)
                   -> (((((id) (((1)) :: Integer))) :: Integer))))))’
      In the expression:
        ((id
          . ((\ a b -> intercalate a $ map (sToA . show . confirmInt) b)
               secondSep))
           ((((\ a b f -> f a b)
                ((((\ x -> [1 .. x]) ((((id) (((4)) :: Integer))) :: Integer))) ::
                   [Integer]))
               (((\ f -> f (()))
                   (\ (arg2t1) -> (((((id) (((0)) :: Integer))) :: Integer))))))
              (((zipWith . \ f a b -> f $ (\ (~a1, ~a2) -> ((a1, a2))) (a, b))
                  (\ (arg2t1, arg2t2)
                     -> (((((id) (((1)) :: Integer))) :: Integer)))))))
nibbles: failed to compile hs (likely an internal nibbles bug, please report it!)
CallStack (from HasCallStack):
  error, called at nibbles.hs:163:24 in main:Main

Min does not work on char

Max works on chars, but min does not, although this would not conflict with another op:

] 'a' 'b' -> 'b'

[ 'a' 'b' ->

nibbles: Parse Error: no matching op, tried: 
[ int num, arg 1 is VChr
[ int vec, arg 1 is VChr
[ int >num, arg 1 is VChr

Incorrect execution in literate mode

This code in literate mode interprets ; @ as save-op instead of referencing ;@:

. , ;4 ~~ $ ; @ $

produces

1 4 4
2 4 4
3 4 4
4 4 4

Compilation converts this to ;@ and produces:

1  1
2  2
3  3
4  4

nibbles: failed to compile hs (tuples)

I suspect this nibbles code is erroneous, but the error message is "please report a bug" rather than a more helpful error message

My attempt at a minimal repro case:

. ; . ;@ ~$$ `& _ 1

Results in the following output:

size = 13 nibbles (6.5 bytes)

out.hs:192:1162: error:
    • Couldn't match type ‘(t0, t1)’ with ‘()’
      Expected type: () -> Integer
        Actual type: (t0, t1) -> Integer
    • In the first argument of ‘\ a1
                                  -> (((: []) . (\ a1 -> ((sToA . show) a1))) a1)’, namely
        ‘(bb ())’
      In the second argument of ‘($)’, namely
        ‘(\ a1 -> (((: []) . (\ a1 -> ((sToA . show) a1))) a1)) (bb ())’
      In the second argument of ‘($)’, namely
        ‘(\ x -> zip x $ map id x)
         $ (\ a1 -> (((: []) . (\ a1 -> ((sToA . show) a1))) a1)) (bb ())’
    • Relevant bindings include
        bb :: (t0, t1) -> Integer (bound at out.hs:192:975)
nibbles: failed to compile hs (likely an internal nibbles bug, please report it!)
CallStack (from HasCallStack):
  error, called at nibbles.hs:163:24 in main:Main

There are a number of variations of this code that can produce different tuple types, but still error in the same place with "Couldn't match type". I personally am unfamiliar with Haskell so I am not able to interpret what is causing the error here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.