Code Monkey home page Code Monkey logo

Comments (9)

otac0n avatar otac0n commented on July 28, 2024

I'm not sure that this is the best way to support AnyCPU. Rather, I think that we should change the order of the field offests, and make the value types come first (with an offset of 0) since Bool and Double have guarantees about their length in the Spec.

Something like:

module BoxedValueOffsets =
  let [<Literal>] ValueType = 0
  let [<Literal>] Tag = 4
  let [<Literal>] Marker = 6
  let [<Literal>] ReferenceType = 8

// Value Types
[<FieldOffset(BoxedValueOffsets.ValueType)>] val mutable Bool : bool
[<FieldOffset(BoxedValueOffsets.ValueType)>] val mutable Number : double

// Type & Tag
[<FieldOffset(BoxedValueOffsets.Tag)>] val mutable Tag : uint32
[<FieldOffset(BoxedValueOffsets.Marker)>] val mutable Marker : uint16

// Reference Types
[<FieldOffset(BoxedValueOffsets.ReferenceType)>] val mutable Clr : Object
[<FieldOffset(BoxedValueOffsets.ReferenceType)>] val mutable Object : CO
[<FieldOffset(BoxedValueOffsets.ReferenceType)>] val mutable Array : AO
[<FieldOffset(BoxedValueOffsets.ReferenceType)>] val mutable Func : FO
[<FieldOffset(BoxedValueOffsets.ReferenceType)>] val mutable String : string
[<FieldOffset(BoxedValueOffsets.ReferenceType)>] val mutable SuffixString : SuffixString
[<FieldOffset(BoxedValueOffsets.ReferenceType)>] val mutable Scope : BV array

from ironjs.

otac0n avatar otac0n commented on July 28, 2024

I would absolutely love to get away from separate X86 and X64 builds, if that is possible, but I have to defer to Fredrik on this one, since I don't know the nuances of the Boxing as well as he does.

If we do this, I will immediately get a build of the project up on NuGet, since this was the primary reason for holding off.

from ironjs.

ChaosPandion avatar ChaosPandion commented on July 28, 2024

We may want to start using discriminated unions to circumvent the issue completely. From an API perspective this shouldn't be a major change. However the performance benefits of tagged unions are currently unknown to me from within a managed language.

from ironjs.

fholm avatar fholm commented on July 28, 2024

@ChaosPandion: We have to use this struct because of the performance implications of using a tagged union,this struct is the fastest possible way to do dynamic typing within the DLR

from ironjs.

otac0n avatar otac0n commented on July 28, 2024

@fholm: Are my changes feasible? I'm running the tests right now, but I cant test for regressions, since I hadn't run the tests before on this machine. (And, I have no access to the tests on my home computer right now, either.)

from ironjs.

otac0n avatar otac0n commented on July 28, 2024

(Sorry, Github auto-closed the issue.)

I have run the Sputnik tests, and there were no regressions. I have also reconfigured the solution and project files to reflect the unified processor format.

@fholm, I'll let you make the decision on whether to merge this into master.

from ironjs.

otac0n avatar otac0n commented on July 28, 2024

@jlarsson, we have made the update. I have also pushed it to NuGet! Whee!

from ironjs.

jlarsson avatar jlarsson commented on July 28, 2024

Ty guys. It works like a charm with NuGet.

from ironjs.

axefrog avatar axefrog commented on July 28, 2024

Thanks for the update! Now I can move over from Jint :)

from ironjs.

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.