Git Product home page Git Product logo

Comments (2)

zaskar9 avatar zaskar9 commented on August 19, 2024

I very much like the idea of standardizing/defining how wide each type is w.r.t. to the target platform! The proposal you made for the different platforms looks reasonable to me!

My impression is that no version of Oberon ever truly targeted a 64-bit platform. For example, I've been looking at Andreas Pirklbauer's Extended Oberon as part of my effort to port some of the standard modules to oberon-lang. In Texts.WriteInt the argument is LONGINT, but is immediately assumed to be 32-bit on line 447.

IF ROR(x, 31) = 1 THEN WriteString(W, " -2147483648")

In dealing with legacy code and Oberon-07, I think it would make sense to have a switch to use 32-bit sizes, even on a 64-bit platform. Depending on how we detect the width of the platform, this could maybe even be achieved by "cross-compilation" based on the target triplet.

from oberon-lang.

tenko avatar tenko commented on August 19, 2024

Yes, high probability legacy code would fail here anyway this is arranged with 64bit sizes in the mix.

On the XDS compiler the type LONGLONGINT is introduced to keep LONGINT 32bit.
Then there is need for separate type for SYSTEM.ADR and LEN will be limited to 32bit
which is not ideal, but legacy code will continue to work.

Note I changed the size of SHORTINT to be 8bit on all platforms.
It seems the use cases I could find was operation on ORD(ch) or SYSTEM.VAL(BYTE, var)
as arithmetic with numbers are not allowed on CHAR and BYTE.

GCC and CLANG have the -m16 .. -m32 flags to select the integer sizes.
This could probably be reused here.

The default width could be taken from the target triple with the possibility of override with the -m flag.
If LONGINT is forced to 32bit on a 64bit target with the -m32 flag, obviously SYSTEM.ADR
would not work any more and a warnings probably should be given.

from oberon-lang.

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.