Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jarl Gullberg
    @Nihlus
    It's declared as a pure package, but I can't instantiate it in anything Preelaborate or higher
    thindil
    @thindil:matrix.org
    [m]
    @Nihlus: I wonder what happening at a-crbltr.ads:74. 😉 Generally, I agree with advice to use arrays. Bounded containers are a bit messy (may work or not on different Ada compilers). More info: https://www.reddit.com/r/ada/comments/kvvdtx/video_man_live_streams_his_experience_learning/gk1t3bu/
    Jarl Gullberg
    @Nihlus
    @thindil:matrix.org That particular line looks like this Nodes : Nodes_Type (1..Capacity) := (others => <>)
    It's in Ada.Containers.Red_Black_Trees
    thindil
    @thindil:matrix.org
    [m]
    Yes, just started looking at it. And it has right, it isn't static default
    Jarl Gullberg
    @Nihlus
    So... are they just broken/unusable in Shared_Passive?
    thindil
    @thindil:matrix.org
    [m]
    Or add Capacity also to setting, as far I see it is required for bounded containers
    Jarl Gullberg
    @Nihlus
    I did try that (by adding it as a plain generic parameter), but obviously, that doesn't work
    Is there some other way for me to add it?
    thindil
    @thindil:matrix.org
    [m]
    Not sure if it works, but maybe:
    package Sample_Maps is new Ada.Containers.Bounded_Ordered_Maps ( Key_Type => Natural, Element_Type => Sample_Record ) with Capacity => 10;
    Jarl Gullberg
    @Nihlus
    Not a valid aspect identifier, unfortunately
    thindil
    @thindil:matrix.org
    [m]
    Hm, the problem is with the Shared_Passives pragma. Removing it and everything works.
    Jarl Gullberg
    @Nihlus
    Yeah, it implies Preelaborate
    thindil
    @thindil:matrix.org
    [m]
    not only, it forbids also a few things 🙂 http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-E-2-1.html
    Jarl Gullberg
    @Nihlus
    Right
    In this case, Preelaborate is the primary culprit, though
    Смаколик
    @cmakoluk:matrix.org
    [m]
    A possible solution is to write a custom container type and mark it preellabote initialized
    Irvise
    @irvise:matrix.org
    [m]
    I think some of you will be interested in https://www.embeddedonlineconference.com/ ( @Fabien-Chouteau )
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]

    Interesting read https://www.wsj.com/articles/berkshire-hathaways-stock-price-is-too-much-for-computers-11620168548

    Can ada provide solution to high numbers ? Or this one depends on hardware

    Henrik Härkönen
    @heharkon
    One could use Big_Integer (on basically any language) but perhaps they are relying on regular integers etc?
    Henrik Härkönen
    @heharkon
    Or eh, big decimal, but anyway...
    But yes, probably using Ada would make more sense :smile:
    Irvise
    @irvise:matrix.org
    [m]
    The issue here is that they seem to be using 32bit unsigned "shifted" numbers. Aka, the base unit is 0.0001 dollar. In the banking sector they use signed 64 bit integers with 0.0001 as the basic unit. Theoretically, I think, the maximum amount of money would be like 6 quadrillion units. There is a nice video in Youtube that explains this.
    The problem of using bignum is that the size of the data is unknown, which can lead to a lot of issues. I am not saying it should not be done (the scientific community dies for these things) but if it is not necessary, better not use it.
    Henrik Härkönen
    @heharkon
    That's true also... difficult tradeoffs.
    FARIDKH
    @FARIDKH
    Hi folks
    is there anyone who is up to ADA freelance jobs for exam?...
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    onox
    @onox
    @FARIDKH are you that person on Reddit who has an exam in 10 days?
    Henrik Härkönen
    @heharkon
    @Fabien-Chouteau last summer I followed your nice instructions how to use Ada on Micro:Bit ( https://blog.adacore.com/ada-on-the-microbit ) but the board was a loaner, and now I was thinking of buying a couple of those for myself. but it seems that now there's v2 of the board, and it has a speaker, microphone, faster processor, more flash and more ram. would those instructions still apply for that? I don't know has the "idProduct" value changed for example?
    Fabien Chouteau
    @Fabien-Chouteau
    No the drivers that we have right now are only for the v1. v2 has a different CPU and schematic.
    That being said we do have the lowlevel drivers for the V2 CPU (nRF52) but someone would have to implement all the microbit layer.
    Henrik Härkönen
    @heharkon
    @Fabien-Chouteau ok, thanks! I guess I could get v1 still from somewhere, until then :)
    Henrik Härkönen
    @heharkon
    is it regarding mostly stuff under Ada_Drivers_Library/boards/MicroBit/src/zfp/ folder or even on higher level? (I really don't understand these things yet, just tossing my guesses around :) )
    Fabien Chouteau
    @Fabien-Chouteau
    Yes that's the Ada_Drivers_Library/boards/MicroBit/src/zfp/ stuffs
    Henrik Härkönen
    @heharkon
    too bad, assembly and linker scripts are WAY beyond my possible contributing capabilities (not that with my current Ada 'skills' I would have yet helped either) 😂
    2 replies
    Fabien Chouteau
    @Fabien-Chouteau
    That's perfect because the assembly and linker script are automatically generated by a tool ^^
    Henrik Härkönen
    @heharkon
    ah! is the adl_config.ads the source for the generator?
    or some external source
    Fabien Chouteau
    @Fabien-Chouteau
    no it's something else
    I don't have time to explain now. Can you ping me tomorrow or early next week?
    Henrik Härkönen
    @heharkon
    no worries :) lets continue later, yes :)
    1 reply
    Henrik Härkönen
    @heharkon
    I'll order some Micro:Bits in the meanwhile :smile:
    Irvise
    @irvise:matrix.org
    [m]
    On the other hand startup-gen abstracts the general/initial workings of the software, by defining memory regions, ROM/RAM, etc. It generates a boot/linker script to make the software run on that CPU. This information is written in the project file .gpr and can be parametrized.
    Henrik Härkönen
    @heharkon

    @irvise:matrix.org ah, indeed, in the microbit_zfp.gpr there are many configs for that board:

    for Mem_Kind ("flash") use "rom";
    for Address  ("flash") use "0x00000000";
    for Size     ("flash") use "256K";

    etc.

    1 reply
    so for example the MCU definition should be updated to arch/ARM/Nordic/devices/nrf52 for the v2 board etc. I see I see
    Henrik Härkönen
    @heharkon
    and there seems to be board_project_generator py script to get the structures up. so it could be named 'microbit_v2' or something
    Fabien Chouteau
    @Fabien-Chouteau
    @heharkon I quickly did the first steps to get you started: AdaCore/Ada_Drivers_Library#385
    Henrik Härkönen
    @heharkon
    @Fabien-Chouteau thanks! let's see if I can proceed :smile: I ordered couple v2's from Denmark (I live in Finland), they'll probably arrive next week. won't have too much time on computer before that but we'll see...