Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    jere
    @jere1227_twitter
    what you do is in your gpr file indicate which one of the subunit bodies is the body of your spec based on a build switch
    package Naming
    Steve Biedermann
    @hardliner66
    Hi, does anybody know if there is a simple way to cross-compile ada for armv7?
    I already found a tutorial using alire and gnat_arm_elf, but I couldn't get it to work on our dev board (imxsx with a cortex a9).
    is there any way without writing my own runtime? like a flag or something? :s
    Jeremy Grosser
    @JeremyGrosser
    I don't think there's a simple answer to that question
    you can try to use the bare_runtime with -march=armv7-a
    if you don't want to port bb-runtimes, then your best option is to run Linux or an RTOS
    Jeremy Grosser
    @JeremyGrosser
    getting the Cortex-A processors going is a bit more complicated than Cortex-M. There will be a few stages of bootloaders that need to do things like initialize the DRAM controller and load your ELF into memory... Usually you'd use something like u-boot for that.
    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
    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.