9 ms·
T1: A Modern Programming Language for Constrained Environments
- earenndil 7y ago> Everything here is provided under the MIT license. This means that you can use as you wish; you don’t have to credit me Doesn't the MIT license require that it be reproduced with all derivative works, including the copyright line (which includes the author)?
- xeeeeeeeeeeenu 7y agoYes, it does require that, even for binaries. MIT and [23]-clause BSD are probably the most often violated FOSS licenses because most people aren't aware of that. BTW, that requirement is the reason why Boost, 1-clause BSD and 0BSD licenses are a thing.
- saagarjha 7y agoI wonder if this could end up taking more space than the code itself…
- legulere 7y agoYou can also use CC0 for software to dedicate something into the public domain.
- smartmic 7y agoOr use https://unlicense.org/ https://unlicense.org/
- est31 7y agoIn many countries, you can't release your works into the public domain. You can only license them. Thus you should generally avoid CC0.
- zokier 7y agoCC0 is explicitly designed with such legal issues in mind and includes a license for legislations that do not have direct way of putting works to PD > If the waiver isn’t effective for any reason, then CC0 acts as a license from the affirmer granting the public an unconditional, irrevocable, non exclusive, royalty free license to use the work for any purpose. https://wiki.creativecommons.org/wiki/CC0_FAQ#How_does_it_work.3F https://wiki.creativecommons.org/wiki/CC0_FAQ#How_does_it_wo... https://creativecommons.org/share-your-work/public-domain/cc0/ https://creativecommons.org/share-your-work/public-domain/cc...
- est31 7y agoAlright thanks for pointing that out, I misremembered it then.
- vertex-four 7y agoThe point of CC0 is that it puts things in the public domain if possible, and provides the most liberal license if not. See the "public license fallback" - https://creativecommons.org/publicdomain/zero/1.0/legalcode https://creativecommons.org/publicdomain/zero/1.0/legalcode
- fanf2 7y agoCC0 has a mildly problematic patents clause, so if you want to avoid questions about that you might prefer 0BSD. There is a longer explanation on the OSI FAQ https://opensource.org/faq#cc-zero https://opensource.org/faq#cc-zero
- legulere 7y agoBSD is unclear about patents. How is that better than explicitly stating that the license is just about copyright?
- justincormack 7y agoYes, 0BSD is the generally recommended no obligations version https://spdx.org/licenses/0BSD.html https://spdx.org/licenses/0BSD.html
- deleted 7y ago[deleted]
- pdexter 7y agoFor anyone looking for examples, there are some here https://github.com/t1lang/t1lang.github.io/blob/master/NorthSec-20190516.pdf https://github.com/t1lang/t1lang.github.io/blob/master/North... .
- jupp0r 7y agoA code sample on the landing page would have been nice.
- elcritch 7y agoThese slides are handy: https://t1lang.github.io/NorthSec-20190516.pdf https://t1lang.github.io/NorthSec-20190516.pdf
- chubs 7y agoSounds promising! I like the idea of open source projects being an ‘extraction’ from something mission-critical like BearSSL, similarly to Rails’ birth. Also agree totally re the comparisons of other languages, none are really ideal for embedded. Although I suspect that embedded CPUs will simply get more powerful for a given pricepoint, to the stage where we can use basically any language eventually. I suspect the syntax might be too alien for most though.
- speps 7y agoT0 mentioned there is already used and available there: https://bearssl.org/gitweb/?p=BearSSL;a=tree;f=T0;hb=HEAD https://bearssl.org/gitweb/?p=BearSSL;a=tree;f=T0;hb=HEAD Example code: https://bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/x509/asn1.t0;hb=HEAD https://bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/x509/asn1... The slides are also much more educative: https://t1lang.github.io/NorthSec-20190516.pdf https://t1lang.github.io/NorthSec-20190516.pdf
- Galanwe 7y agoI don’t quite get the target of this language. The landing page says it should be used for embedded systems, yet the compiler roadmap for v1 contains “ functions for reading and writing files”. What files? This will run on top of an operating system? Why bother with a new language then.
- jzwinck 7y agoTons of embedded devices use files. For example digital cameras, network routers, and handheld GPS all use files as an explicit part of their setup, output, or operation.
- Galanwe 7y agoHu, yes, sure, but do you think it makes sense that your _language_ of choice implements a FAT file system and a file abstraction on top of it in its standard library?! I sure have never seen that
- xondono 7y agoA lot of embedded systems use file storage even while not having an OS. A very cheap way to add storage to low volume productions is to add a microSD card. At that point it’s easier to go for something like FAT and work with that
- yc-kraln 7y agoand yet that sounds like a library and not a core language construct.
- 7thaccount 7y agoSome people like larger languages that have more of the basics rolled into core. Not sure if that fits here though.
- deleted 7y ago[deleted]
- rightbyte 7y agoIt would be interesting to try this or Forth out in some serious embedded system project. I wonder if I would get the "stack based" style to work in my head.
- dewster 7y agoI would argue that a language targeting bare metal type applications should at least be minimally aware of that underlying hardware. A single stack "virtual machine" type language is generally a terrible fit for the 2 and 3 operand register-based processors which dominate the landscape. Every interview of Chuck Moore that I've read has contained zero push-back for his rather wild claims. It's entirely possible for an industry to do go down the wrong path for a while, but at some point, if Forth and stack processing were the giant killers they were cracked up to be, you would see them enter and dominate at least some portion of the mainstream. You can't say they haven't been given enough time. It seems there are many "Forth curious" programmers out there, but they aren't being given the full picture with the various puff pieces and vanity projects floating around that never really go anywhere. It's almost a culture of victimhood.
- 7thaccount 7y agoI believe there has been a wide variety of successful Forth projects including NASA probes. Forth makes more sense when you can be like Chuck and design your own hardware. At that point Forth is more of a minimalist stack-based philosophy that consists of the minimal hardware + software design to accomplish something. Is his way better? It likely has somewhere near the bare possible code and is very efficient system wise. If you wanted a minimal solution and could devote years to the project, then this is nice. Does it make the best usage of developer time? Obviously not in many cases. In today's business world, you just slap some components together, do minimal acceptable testing, push it out and go to the next thing. Cost is important to the customer, so as long as somebody is willing to do that kind of work, everyone has to. Of course the downside is that we've accreted all this tower of abstractions and complexity going from OS to JVM to libraries and source. We already have tons of COBOL that can barely be maintained. Next will be the large Java and Python codebases.
- dewster 7y agoThe Forth success stories tend to be really, really ancient, and therefore almost irrelevant. Much like Chuck's arguments for the merits of stack languages / machines. Processor pipelines have to be at least deep enough to do a wide multiplication or you're basically looking at a toy. I actually have designed my own FPGA soft core barrel processor, it's a special blend of register and stack machine. The blend occurs by placing stacks under the registers themselves. I believe this allows a low register count, 2 operand architecture to be more efficient than it otherwise would be, which minimizes opcode size, and sidesteps most the crazy you get when trying to shoehorn most processes into a single stack environment. But has clear downsides as well, the main one being the stacks can become easily corrupted by any process using them - this is true of any stack machine but you strangely never hear it come up in conversations with Forth types. Stack processors can eliminate much traditional processor state, but the stacks themselves contain state, which is often overlooked.
- as-j 7y agoOk, I know maybe it's too early in this projects lifecycle, but when I read the page this was my initial reaction. As an embedded engineer I found the github page incredibly frustration, and it's tempting to just write it off. If the original author, or anyone else putting a putting together a language page, here's question I shouldn't have to dig for: 1. Where's an example this has been used professionally? (or out side an academic setting) I'm pretty risk adverse since FW/embedded systems are harder to OTA, and changes once we've approved the HW design blows up projects. If it hasn't been, be upfront about it. 2. What's the plan for the project? Is the language stable? Is a standard library next? I use a vendors language/BSP to avoid writing everything little thing from scratch, like printf() 3. Give me a comparison to other languages, why should I use T1 over any other embedded solution. Include size, and maybe the performance hit. 4. Show me some code. If I'm picking this for a project I need to think of everyone else I need to teach the language too, and how they'll accept it. It really helps for a quick glimpse at the syntax to see how foreign it is. Even if it's just Hello World. 5. How do I access peripherals/HW? For example if I need flash/nvram persistent storage, access to the serial port am I back to C to write driver or interface to the BSP? If so I now need good C skills, T1 skills and good binding skills. Thanks for everyone for the slides, reading the hacker comments pretty much answered 1-5: https://t1lang.github.io/NorthSec-20190516.pdf https://t1lang.github.io/NorthSec-20190516.pdf https://bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/x509/asn1.t0;hb=HEAD https://bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/x509/asn1...
- bluejekyll 7y agoIs this actively being developed? I don't see an update for the past 8 months. From https://github.com/t1lang/t1lang.github.io/blob/master/NorthSec-20190516.pdf https://github.com/t1lang/t1lang.github.io/blob/master/North... slides, are telling for the language analysis to see why they think it's necessary to develop this: Go: - Only with TinyGo* - Limited language/runtime support* - "support for goroutines and channels is weak" - Maps can ony have up to 8 (eight!) entries - GC: only for ARM, other platforms "will just allocate memory without ever freeing it" (but GC is required for proper string management) Rust: - Inherits all memory-safety features of Rust - Heap is optional - But without the heap, everything is allocated on the stack - Supports ARM Cortex-M and Cortex-R, RISCV, and MSP430 (experimental) - Not other architectures that LLVM does not support - Typically more stack-hungry than C - Lots of automatic magic Forth: - Many incompatible implementations - It's more a concept than a language (there is an ANSI standard) - You are support to "write your own Forth" - Very compact, with low RAM usage - Even less safe than C and not portable Given all this, is it really cheaper to write a new language than add architecture support to LLVM? I also don't understand the "lots of automatic magic", is that referring to the generics and/or type inference in Rust? Additionally, if not using Heap (the criticism about Heap being optional), where else would you allocate memory besides the Stack? Can someone who does embedded explain that? btw, on the magic bit the T1 design does go on to talk about Generics support and a rich type system. Edit: this comment sounds too negative, and that wasn't really my intent. I just wanted to better understand some of the considerations that were used in deciding to make this new language.
- snops 7y agoI'd be interested to see the comparison against zig[1], which I am eying up as a quite interesting language for embedded development. I think the comparable features would be: - No automatic magic, anything that looks like a function or memory allocation is, anything that doesn't, isnt. - Good compile time code generation capabilities including reflection, much nicer than C macros. - Runtime safety features, such as bounds checking, but not as intrusive as Rust's borrow checker (which makes less sense for single threaded embedded applications). These can be turned off in release builds. - Very good C interop for use with manufacturer HAL libraries etc, includes a C compiler. - Better error handling than C, without needing full exceptions, instead the "try" and "defer" macros nicely replace C's "goto" for error handling[2]. - No garbage collection - Embedded is a first class target, unlike Go/TinyGo - Working async support on all platforms. - Sadly not as popular as others, one full time developer currently I think. [1] https://ziglang.org/ https://ziglang.org/ [2] https://eli.thegreenplace.net/2009/04/27/using-goto-for-error-handling-in-c https://eli.thegreenplace.net/2009/04/27/using-goto-for-erro...
- mwcampbell 7y agoFor me the most interesting part of T1 is the ability to strongly guarantee maximum stack usage, and the accompanying ban on general recursion. Are there any other languages or compilers that do this?
- stefano 7y agoI think Ada, in its SPARK dialect, should be able to do this.
- zokier 7y agoResource Aware ML is a research language which analyzes resource usage, including memory bounds http://raml.co/ http://raml.co/
- MrBuddyCasino 7y agoRust does: https://github.com/japaric/cargo-call-stack https://github.com/japaric/cargo-call-stack
- heyflyguy 7y agoI'd love to see a statistic on the number of new languages announced on HN.
- tsegratis 7y agoFrom t1spec.pdf: "Postfix source code can be readily serialized into an executable format running on threaded code, a well-known code generation method that can allow for a very small compiled code footprint" What's that method?
- rabidrat 7y agoYou take each symbol in sequence and append a reference to the compilation output. It's super easy and it results in a very small code footprint (it can often be smaller than compiled C for equivalent code).