Code Monkey home page Code Monkey logo

Comments (6)

hellerve avatar hellerve commented on May 24, 2024 1

What has changed is the order in which things are ran:

it used to be:

loadFilesOnce startingContext coreModulesToLoad
            >>= load [carpProfile | hasProfile]
            >>= execStrs "Preload" preloads
            >>= load argFilesToLoad
            >>= execStrs "Postload" postloads

And now is

pure startingContext
          >>= load [carpProfile | hasProfile && profile]
          >>= execStrs "Preload" preloads
          >>= loadOnce coreModulesToLoad
          >>= load argFilesToLoad
          >>= execStrs "Postload" postloads

But I also can’t remember why.

As for It's not possible to def a String for example:, in your example you use --eval-preload. Shouldn’t it be postload instead?

from carp.

hellerve avatar hellerve commented on May 24, 2024

Isn’t this a case for --eval-postload?

from carp.

TimDeve avatar TimDeve commented on May 24, 2024

I guess that would work for (Debug.sanitize-addresses) but not for the other usages.

It's not possible to def a String for example:

$ echo "(defn main [] (IO.println &wow))" > main.carp
$ carp -x --log-memory --eval-preload '(def wow @"string")' main.carp
I can’t find any implementation for the interface `copy` of type (Fn [(Ref String r3)] String) at line 1, column 10 in 'Preload'.

None of the possibilities have the correct signature:
    Array.copy : (Fn [(Ref (Array a) q)] (Array a))
    Pointer.copy : (Fn [(Ref (Ptr p) q)] (Ptr p))
    Box.copy : (Fn [(Ref (Box t) q)] (Box t))
    Function.Arity0.copy : (Fn [(Ref (Fn [] z) q)] a)
    Function.Arity1.copy : (Fn [(Ref (Fn [d] z) q)] a)
    Function.Arity2.copy : (Fn [(Ref (Fn [d, e] z) q)] a)
    Function.Arity3.copy : (Fn [(Ref (Fn [d, e, f] z) q)] a)
    Function.Arity4.copy : (Fn [(Ref (Fn [d, e, f, g] z) q)] a)
    Function.Arity5.copy : (Fn [(Ref (Fn [d, e, f, g, h] z) q)] a)
    Function.Arity6.copy : (Fn [(Ref (Fn [d, e, f, g, h, i] z) q)] a)
    Function.Arity7.copy : (Fn [(Ref (Fn [d, e, f, g, h, i, j] z) q)] a)
    Function.Arity8.copy : (Fn [(Ref (Fn [d, e, f, g, h, i, j, k] z) q)] a)
    Function.Arity9.copy : (Fn [(Ref (Fn [d, e, f, g, h, i, j, k, l] z) q)] a) at Preload:1:2.

Traceback:
  (def wow (copy "string")) at Preload:1:1.

from carp.

scolsen avatar scolsen commented on May 24, 2024

huh, whatever changed the behavior is not obvious. the actual pre/post impl haven't changed at all since they were first implemented, as far as I can tell

might need to do a git bisect and check the behavior at each stage. presumably we can use the commit that introduced the feature as the good commit: 6bce3b1

from carp.

TimDeve avatar TimDeve commented on May 24, 2024

Postload runs after the user files so you can't inject things to be used by these files.

But I also can’t remember why.

Git blame says the last changes were two years ago and that's a formatting commit, clearly I haven't used preload in a while then.

from carp.

TimDeve avatar TimDeve commented on May 24, 2024

I'm just gonna close this, it seems that preload use to behave differently but if that was two years ago then it doesn't feel that that this is a useful.

from carp.

Related Issues (20)

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.