https://toitlang.org/ logo
Join Discord
Powered by
# general
  • k

    kasperl

    11/02/2025, 5:10 PM
    If you can start the tasks in one place, you might benefit from the
    Task.group
    helper.
  • k

    kasperl

    11/02/2025, 5:12 PM
    https://libs.toit.io/core/task/class-Task#group(2%2C0%2C0%2Crequired)
  • ubx-message parser/ublox-gnss-driver - improvements
    m

    milkmansson

    11/06/2025, 3:02 PM
    Reverse engineered what was going on with the ublox 6M and why it wasn't getting a fix. Anyone keen to give us a hand to test?
    • 1
    • 3
  • b

    bmentink

    11/06/2025, 10:22 PM
    I am having trouble setting artemis up on a new laptop. When I do the
    artemis auth login
    and follow the link, the browser refuses to redirect after I enter the login details ..
  • f

    floitsch

    11/06/2025, 10:23 PM
    I will try to reproduce. Hopefully today. If not tomorrow
  • b

    bmentink

    11/06/2025, 10:23 PM
    ok, thanks
  • n

    nas2011

    11/07/2025, 12:24 PM
    Is there an efficient way to test a Deque for length of non-null items? I have a use case where I want to use the reserve method to preallocate but I need to test the size of contents. Using reserve makes it so that 'mydeque.size' returns the reserved length, even with no contents.
  • f

    floitsch

    11/07/2025, 12:31 PM
    I think that's actually a bug in the implementation. Reserve should only reserve the space and not change the size.
  • f

    floitsch

    11/07/2025, 12:44 PM
    Looking at the code, I can relatively easily fix it for
    add-first
    but not for
    add
    .
  • f

    floitsch

    11/07/2025, 1:33 PM
    I think I have it now.
  • n

    nas2011

    11/07/2025, 8:14 PM
    Glad to hear. That was my expectation which is why the first test loop results surprised me. Thanks for looking at it.
  • f

    floitsch

    11/07/2025, 8:45 PM
    PR is uploaded
  • b

    bmentink

    11/08/2025, 9:03 PM
    Any luck reproducing? This is what I got.. https://cdn.discordapp.com/attachments/918498540232253483/1436823446293319761/redirect.png?ex=6911019c&is=690fb01c&hm=78f449ddb45b9e6b12890ef27ac6e10b94077fafe91e6daa5b7259fa491825eb&
  • b

    bmentink

    11/08/2025, 9:12 PM
    This is via google https://cdn.discordapp.com/attachments/918498540232253483/1436825663184044314/google.png?ex=691103ad&is=690fb22d&hm=4c27cd2d60ef14e3f45bafeae4868b046bbd8c8ca7faeb978083c0a6335a90a7&
  • f

    floitsch

    11/08/2025, 9:35 PM
    Argh. Completely forgot. Sorry. Same: hopefully today or tomorrow.
  • f

    floitsch

    11/08/2025, 10:06 PM
    I think I have an idea of what's going on. We bought a custom domain on supabase and apparently the login uses that one now. Will try to fix.
  • f

    floitsch

    11/09/2025, 12:10 AM
    Could you try again? I think I have updated the oauth settings.
  • b

    bmentink

    11/09/2025, 3:33 AM
    All Fixed
  • m

    MichaelK

    11/10/2025, 9:10 AM
    I'm having some trouble getting a characteristic from a smart device. Heart Measurement (0x2A37) isn't read, only notified (you can see the corresponding exception in JAG monitor). Therefore, reading is replaced with subscribing. I tested this in Flutter using the flutter_reactive_ble package, and it works. I noticed that ble of Toit also supports notifications and subscribing, but it's unclear how to use this mechanism, and the examples don't explain it. If it's easy, could you please clarify how it works? Thanks in advance. JAG monitor
    Copy code
    [jaguar] INFO: program 94e7226f-cba3-e548-86bb-a0233c7c1731 started
    address->#[0x00, 0x07, 0x35, 0x00, 0xcf, 0x83, 0x72]
    device connected...
    Exception: Characteristic does not support reads
    [jaguar] INFO: program 94e7226f-cba3-e548-86bb-a0233c7c1731 stopped
    https://cdn.discordapp.com/attachments/918498540232253483/1437368694383710249/find_device.toit?ex=6912fd69&is=6911abe9&hm=a185c0d9bde3b335ad0cdc3ba78157d26aef5730690ec9a6923c37c40a1b0e3f&
  • f

    floitsch

    11/10/2025, 9:29 AM
    It should be as simple as:
    Copy code
    heart-characteristic.subscribe
    while true:
      new-value := heart-characteristic.wait-for-notification
    I don't remember what happens if you don't call
    wait-for-notification
    enough. Whether the values are queued (using up memory), or discarded. If you only need one value, you should just
    subscribe
    , then
    wait-for-notification
    , and then
    unsubscribe
    .
  • f

    floitsch

    11/11/2025, 10:47 AM
    Slightly delayed weekly update: - started to rewrite the uart driver. Hopefully this will make it work on the C6. - wrote a PR to replace our double->string conversion function. We should now get the shortest accurate string when doing a
    to-string
    or
    stringify
    . In the process deprecated all
    {num|int|float}.stringify
    functions that took arguments and redirect them to
    to-string XXX
    . (`to-string`: explicit well defined conversion. `stringify`: give me a string representation; maybe for debug).
  • n

    nas2011

    11/11/2025, 9:21 PM
    I'm trying to figure out some behavior that I'm not understanding. I have the following classes:
    Copy code
    // Base class for all AST nodes.
    class AstNode:
      line_/int
      col_/int
    
      constructor .line_ .col_:
    
      // A simple stringify for debugging.
      // Subclasses should override this.
      stringify -> string:
        return "AST Node: ($line_:$col_)"
    
    
    // --- File Nodes ---
    
    class LibFileNode extends AstNode:
      entries/List // List<NamedSpecNode | NamedDataNode>
    
      constructor line_/int col_/int .entries:
        super line_ col_
      
      stringify -> string:
        return "LibFileNode: entries:$entries"
    When I run a parsing function that returns an instance, called
    result
    of
    LibFileNode
    I can validate this with
    result is LibFileNode
    which does return
    true
    , however if I try and run
    print result.entries
    I get an error saying:
    Copy code
    error: Class 'AstNode' does not have any method 'entries'
    Shouldn't the
    Instance.field
    getter work by default?
  • f

    floitsch

    11/11/2025, 9:23 PM
    It should.
  • f

    floitsch

    11/11/2025, 9:23 PM
    What happens if you just
    print result
    ?
  • f

    floitsch

    11/11/2025, 9:23 PM
    Oh wait.
  • f

    floitsch

    11/11/2025, 9:25 PM
    You are just doing an
    is
    check? Unfortunately we haven't implemented automatic downcasting yet. Use
    (result as LibFileNode).entries
  • n

    nas2011

    11/11/2025, 9:29 PM
    Thank you. That did it. On a related note, is there a way to access the name of the class to which an object belongs? For example in the case of my
    result
    example is there a function that would return
    LibFileNode
    ? Thinking of something like
    typeof
    in other languages.
  • f

    floitsch

    11/11/2025, 9:30 PM
    No. The names of classes take too much space. You can use
    jag toit tools snapshot ...
    to get the name from an id. (Don't remember the exact command)
  • z

    z3ugma

    11/12/2025, 5:20 AM
    Do you think the
    http
    package can implement long-polling?
  • f

    floitsch

    11/12/2025, 8:13 AM
    I don't see any reason why not. I just skimmed the sources and didn't see any timeout. If there is one I missed we could probably make it configurable. Did you already try it?