Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jeremy Grosser
    @JeremyGrosser
    it looks like i.MXS is a very old chip... I'm not sure it's worth the effort unless you have some existing hardware you absolutely cannot change
    Steve Biedermann
    @hardliner66
    we use a custom built yocto linux
    changing it is not really a possibility. our board is deployed a few 100000 times at the very least. We have older boards too, but right now i'm just checking if we can run ada code at all
    Simon Wright
    @simonjwright
    @hardliner66, you presumably have a host environment, I’m guessing Linux, where you cross-build code to run under Linux on your target board. If you can run GNAT on your host, you’re I’d expect most of the way there.
    You might find the basis of an approach in the first half of this script runs an x86_64 Ada-capable compiler (on an M1 Mac; not sure this is necessary) to build an x86_64 cross compiler to aarch64 (Apple silicon), which might be all you need; the second part uses that to build a native aarch64 compiler, which you wouldn’t need unless you want to compile on the target.
    Of course, there’s a whole load of mac-isms in there!
    Steve Biedermann
    @hardliner66
    Thanks a lot. I'll have a look.
    Simon Wright
    @simonjwright
    I think I may have failed to mention a couple of points:
    Macs (x86_64, aarch64) are very very similar; you’ll probably need to have a copy of the target libraries on the host system; the last time I did this was in 2005 or so, linux / vxworks 5.3
    In all cases, building a cross-compiler is best if you have a host compiler built from the same sources.
    1 reply
    ethin
    @ethindp:the-gdn.net
    [m]
    I feel like we need an Ada compiler that's purely LLVM-based so we can avoid the msys2 weirdness on windows. Or try to. I just set up Alire using the installer and bash kept giving memory sigbase mismatches or something like that... The error was the familiar 0 [main] bash (2588) C:\Users\ethin\.cache\alire\msys64\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1289408/0x11D9408. The fact that errors like this still happen is just ridiculous IMO.
    The odd thing is that I don't really have multiple cygwin installs on here. I mean I have the coreutils package and related friends from Scoop.sh but still...
    Ah, it seems to be ASLR related. Will go mess with that -- though why these binaries don't have ASLR enabled by default nowadays is beyond me
    ajdude
    @ajdude:matrix.org
    [m]

    I've published the initial release of an installer for alire: https://github.com/AJ-Ianozi/getada

    I try to be clear in the readme, and I put some more details here: https://www.reddit.com/r/ada/comments/yzx6hz/getada_an_unofficial_installer_for_alire/

    Смаколик
    @cmakoluk:matrix.org
    [m]
    1 reply
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    Irvise: do you think AURA needs to be in pkgsrc? https://annexi-strayline.com/blog/posts/4 or gcc-aux is enough for now ?
    3 replies
    Irvise
    @irvise:matrix.irvise.xyz
    [m]
    With that, we would have a base to do pretty much the rest.
    Maxim Reznik
    @reznikmm
    Advent of Code - an online programming challenge has started today. Join us with Ada (or even SPARK) solutions and have a fun! 🥳
    1 reply
    Maxim Reznik
    @reznikmm
    Unofficial Advent of Code survey has Ada in the programing language list :)
    Jasen Qin
    @hyperswine
    coming from rust, is alire like cargo with cargo.toml, unit & integration testing, examples, docs, etc?
    Fabien Chouteau
    @Fabien-Chouteau
    @hyperswine Alire is also a package manager with a similar workflow, but unit & integration testing, examples, docs are not as well integrated at the moment.
    Doesn't mean you can do "unit & integration testing, examples, docs", but it will be different than how you do it with cargo.
    We have a work-in-progress :registered: repo that explain the Alire workflow: https://github.com/alire-project/ada_spark_workflow
    Jasen Qin
    @hyperswine
    oh I’ll check it out :thumbsup:
    Barry Houser
    @barryhouser:matrix.org
    [m]
    Does anyone know how to attach a python debugger to Gnat Studio?
    Irvise
    @irvise:matrix.irvise.xyz
    [m]
    Barry Houser: this is just me guessing. But you could drop into the gdb terminal window and then do whatever setup you need there to connect the Python process... But this is just me guessing.
    GNAT Studio uses GDB basically.
    Barry Houser
    @barryhouser:matrix.org
    [m]
    I just read AdaCore's recently released "Introduction to Embedded Systems Programming" by Patrick Rogers. It's an excellent source of information on not only how to approach embedded systems development, but covers some of the more advanced, rarely discussed areas of the language. I was delighted when it directly addressed an issue I've been grappling with. While Ada encourages high-level abstractions when specifying a model, such as representing a device's status flags as boolean fields in a record, or defining a bank of registers as an indexable array of 32-bit unsigned values, it's unclear how they're implemented at the low level. Specifically, will the compiler wastefully generate a sequence of load and store instructions when setting several status flags in a record to true, or will it efficiently reduce those assignments into a bit mask and set them in single operation? The guide goes into depth how aspects such as atomic, volatile and full_access can specify the intent at the machine level. Coming from other languages such as C/C++, the ability to write code at an abstract level, instead of dumbing it down for the sake of the compiler has been an incredible revelation. The guide is a must read for not just embedded Ada development, but for all Ada development!
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]

    Sorry but i had to test GPT for spark programming language:
    Can you write "hello world" in spark programming language?

    Yes, here is how you can write "Hello World" in Spark:

    import org.apache.spark.SparkContext
    import org.apache.spark.SparkContext._
    import org.apache.spark.SparkConf

    object HelloWorld {
    def main(args: Array[String]) {
    val conf = new SparkConf().setAppName("Hello World")
    val sc = new SparkContext(conf)
    val rdd = sc.parallelize(List("Hello World"))
    rdd.foreach(println)
    }
    }

    In this example, we first import the necessary classes from the Spark API. Then, we create a SparkConf object that contains the configuration for our Spark application. Next, we create a SparkContext object using the SparkConf object. This is the main entry point for Spark functionality.

    Next, we create an RDD (Resilient Distributed Dataset) containing the string "Hello World". An RDD is the main data structure in Spark and is a distributed collection of elements. In this case, we create an RDD from a List containing the string "Hello World".

    Finally, we use the foreach method to print each element of the RDD to the console. When run, this program will print "Hello World" to the console.

    It went for wrong spark 🤣
    Maxim Reznik
    @reznikmm
    :(
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    @reznikmm: Probably due to Spark being not that famous or lesser code samples available online for it to be included in study material
    bgtlover
    @bgtlover:stealthy.club
    [m]
    write specifically for ada, hello world in spark would be equivalent to hello world in ada in this case. I recommend you give it a procedure in spark and tell it to identify the language or something, so you can find out if it knows the language.
    1 reply
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    Manuel Hatzl: Thanks for confirming. Most probably it didn't have enough material to study so gpt unable to produce complex codes
    Artix Fox
    @artixfox-:matrix.org
    [m]
    is it possible to make android apps using ada?i like working with Ada because of the strong typesystem it offers which leads to clean codebase
    but a competition in my school requires me to make an android app
    is there something for that in Ada, its not somethign ada is made to do, but its possible in C and zig. It would probably be an amazing experience to build an android app in ada
    Maxim Reznik
    @reznikmm
    I heard C uses Qt to create an android application. There was an Ada Qt binding, but I don't know if it is possible to use it on android or not.
    Artix Fox
    @artixfox-:matrix.org
    [m]
    this is neat but it uses webassembly, Would it be possible to not use it like https://github.com/cnlohr/rawdrawandroid does it
    Maxim Reznik
    @reznikmm
    😲
    Fabien Chouteau
    @Fabien-Chouteau
    The Ada booth proposal for FOSDEM is accepted :partying_face: https://fosdem.org/2023/news/2022-12-08-accepted-stands-fosdem-2023/ @irvise:matrix.irvise.xyz
    1 reply
    Irvise
    @irvise:matrix.irvise.xyz
    [m]
    I'll see you in FOSDEM then! Now I need to ask for some holidays x)
    Barry Houser
    @barryhouser:matrix.org
    [m]
    Yeah! 👏 👏 👏 👏
    Steven Bos
    @aiunderstand

    I just read AdaCore's recently released "Introduction to Embedded Systems Programming" by Patrick Rogers. It's an excellent source of information on not only how to approach embedded systems development, but covers some of the more advanced, rarely discussed areas of the language. I was delighted when it directly addressed an issue I've been grappling with. While Ada encourages high-level abstractions when specifying a model, such as representing a device's status flags as boolean fields in a record, or defining a bank of registers as an indexable array of 32-bit unsigned values, it's unclear how they're implemented at the low level. Specifically, will the compiler wastefully generate a sequence of load and store instructions when setting several status flags in a record to true, or will it efficiently reduce those assignments into a bit mask and set them in single operation? The guide goes into depth how aspects such as atomic, volatile and full_access can specify the intent at the machine level. Coming from other languages such as C/C++, the ability to write code at an abstract level, instead of dumbing it down for the sake of the compiler has been an incredible revelation. The guide is a must read for not just embedded Ada development, but for all Ada development!

    This is such a great read. Thanks for sharing this.

    Peter Tihanyi
    @tipeter
    Hello! Could you help me how to build a stm32f429-discovery example project from Ada_Drivers_Library?
    I am using Ubuntu linux, have Alire installed and can create/build native projects. I also have gnat-arm-elf toolchain installed with alr.
    Peter Tihanyi
    @tipeter

    I tried the following:
    I cloned the repository, and created a library project in-place with alr in the repo directory. Then I selected gnat-arm-elf toolchain.
    Then I issued this:

    alr exec – ./scripts/install_dependencies.py

    The process stops with the following error:

    ROOT_DIR :/home/ptihanyi/adawsp/Ada_Drivers_Library
    /home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes already cloned
    Running build command:
    $ /usr/bin/python3 /home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes/install.py --arch=arm-eabi --prefix=/home/ptihanyi/.config/alire/cache/dependencies/gnat_arm_elf_12.2.1_9be2ca0e/bin/../arm-eabi/lib/gnat
    install runtime sources for stm32f4
    
    Dependency install command error (returned 1):
    Traceback (most recent call last):
      File "/home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes/./build_rts.py", line 317, in <module>
        main()
      File "/home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes/./build_rts.py", line 293, in main
        projects += installer.install(
      File "/home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes/support/bsp_sources/installer.py", line 168, in install
        runtime_sources = self._find_rts_sources(destination, rts_descriptor)
      File "/home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes/support/bsp_sources/installer.py", line 145, in _find_rts_sources
        assert ret is not None, "Cannot find %s" % rts_json_file
    AssertionError: Cannot find rts-sources.json
    Traceback (most recent call last):
      File "/home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes/install.py", line 74, in <module>
        main()
      File "/home/ptihanyi/adawsp/Ada_Drivers_Library/bb-runtimes/install.py", line 70, in main
        subprocess.check_call(cmd)
      File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', './build_rts.py', '--build', '--force', '--output=/home/ptihanyi/.config/alire/cache/dependencies/gnat_arm_elf_12.2.1_9be2ca0e/arm-eabi/lib/gnat', 'stm32f4', 'nucleo_f401re', 'stm32f429disco', 'stm32f469disco', 'stm32f746disco', 'stm32756geval', 'stm32f769disco', 'samg55', 'sam4s', 'samv71', 'openmv2', 'rpi2', 'feather_stm32f405', 'stm32f051r8-hsi', 'nrf52832', 'nrf52840', 'cortex-m0', 'cortex-m0p', 'cortex-m1', 'cortex-m3', 'cortex-m4', 'cortex-m4f', 'cortex-m7f', 'cortex-m7df', 'cortex-m23', 'cortex-m33f', 'cortex-m33df', 'rpi-pico', 'rpi-pico-smp']' returned non-zero exit status 1.

    Many thanks!

    Fabien Chouteau
    @Fabien-Chouteau
    I replied on forum.ada-lang.io
    Peter Tihanyi
    @tipeter
    Thanks!
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    Ada has something similar?
    https://reanimate.github.io/
    5 replies
    Peter Tihanyi
    @tipeter
    Hi! In GNAT Pro 22 / GNAT FSF 12 zfp embedded runtime replaced by "light"? I'm experimenting with startup-gen (based on this blogpost), and "zfp-cortex-m4f" not working...
    2 replies
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    Irvise_: 😅
    Jaypatelani
    @Jaypatelani:matrix.org
    [m]
    Barry Houser: it will be probably unusable code
    1 reply
    I am not sure logic will be copied but someone can pick that up and create something out of it
    Barry Houser
    @barryhouser:matrix.org
    [m]
    Here's a sample of an animation in SVG:
    <svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
      <rect width="10" height="10">
        <animate
          attributeName="rx"
          values="0;5;0"
          dur="10s"
          repeatCount="indefinite" />
      </rect>
    </svg>