Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My personal opinion is that good typescript to C transpiller would do a way better job, tons of microcontrollers supported out of the box. I would be also happy to use it for desktop. With some tricks it could even support references and additional numeric data types (u8, i8 ... ) without breaking any syntax


Pure Typescript supporting all of the Ecmascript spec would have to output a lot of C to get the same results.


It obviously would have to be a limited subset, like devicescript is also "just" a subset of typescript.

I think the limitations for devicescript would probably also work for outputting reasonable amounts of C.


I think a language that just transpiled to the equivalent C would be pretty awesome. I know Google is building Carbon, but it is more focused on C++. They pitch it as Typescript to JavaScript, Scala to Java, Carbon to C++.

Instead of Rust or Zig trying to replace C++ or Java, is seems better to just integrate with it without linking through some FFI.

I'm working on some C code for some microcontroller since it was too difficult to use Rust.


I use Nim on embedded precisely for that reason: https://github.com/elcritch/nesper

I wtapped much of zephyr as well but that ones less used: https://github.com/embeddednim/nephyr


I could be wrong, but doesn't vlang and nim do this?


In the case of V, it's already there to do much of what is being wished for. V (an easier higher level C family language) can be transpiled to readable C. Even more, V can transpile C to V (C2V) and can be used like a scripting language, even though it's a compiled language.


Has vlang managed to get past its controversies and actually deliver on its promises? Last I heard it was still promising too much, under delivering and not handling the feedback too well.


>Last I heard it was still promising too much, under delivering and not handling the feedback too well.

This is an odd statement, as if pushing along an artificially generated negative narrative. It comes across as not using or having never used what one is talking about. Therefore using hearsay and rumor ("last I heard"), which easily can come from competitors and trolls, as the basis of information versus facts.

Constructive feedback would be going to their GitHub and making suggestions, filing useful bug reports, or helping to implement some feature (for those who are really as technically skilled as they claim elsewhere).

> Has vlang managed to get past its controversies and actually deliver on its promises?

The V project is constantly delivering. This can be seen by their near weekly updates, projects on VPM, projects on Awesome V, etc...

The so-called "controversies", have much to do with competitors and trolls, as with anything else.


To be clear: Vlang overpromised and underdelivered on many features. It also included features by shelling out to other executables like curl.

It might have all been fixed by now, but it is a fact that Vlang has had listed many, many, features on its homepage (without any indication that they were work in progress) that had no implementation and that had no proper prototype.

The defensiveness of Vlang supporters is not a good look.


> ...overpromised and underdelivered on many features...

We could argue that all programming languages that aren't 1.0, have not delivered yet. So, with that same energy, it will be interesting to go chase around supporters of Jai, Mojo, Zig, Odin, etc... with the same rhetoric.

Vlang is "delivering" to its users, as evident by its near weekly updates, VPM, or Awesome V site. It's an open-source project and language. Developers are free to join the project to ensure "delivery of the product".

Else if they are not using said product, they don't have to worry about it. It would be bizarre for any person to be so obsessed with something one doesn't want to use, unless maybe competitors who are afraid of that language.

> ...shelling out to other executables like curl.

Vlang doesn't use curl in its modules. Everyone is free to check its source code. It has it's own such functionality, written in V. So that's looks like misinformation.

> ...defensiveness of Vlang supporters...

Didn't know about this new rule, where if one posts a response 16 days later, the other isn't allowed to make a counter point.

By the way, don't represent "all" Vlang supporters. Just giving my personal opinions, here on HN, like others are allowed to and for the languages they like.

> It might have all been fixed by now...

If one doesn't know about the thing they are talking down on ("It might"), then that looks like something very odd is going on. Doesn't make sense to worry and talk about something that one doesn't use, except again a competitor or just out to troll.

> features on its homepage (without any indication that they were work in progress) that had no implementation and that had no proper prototype...

Maybe there is confusion about what year or what time period being talked about. This is the year 2023. Perhaps what is being referred to is 2019, the first day(s) of the language being released, or mistakes on its website. Here's the thing though, its a free open-source language. Pretty sure such mistakes have happened on websites and with other languages before (especially just released ones).

Not seeing people on HN chasing down supporters of Jai, Mojo, Zig, Odin, etc... about stuff on their website from 4 and 5 years ago that nobody cares about. Furthermore, people freely choose to use, support, or donate. Not understanding being upset over what languages other people like to use, well unless...


I have never used it. I just remember reading on the README that is compiles to human readable C.


I that case it might be useful to check previous threads here since vlang has been quite controversial. Or check what they have implemented versus promised.


>...it might be useful to check previous threads here since vlang has been quite controversial.

The majority of controversy has been generated by competitors and detractors using various social media platforms to spread misinformation. To include identified troll accounts created specifically for the purpose of launching such attacks. Something like, "throwing stones and hiding their hands".

It would arguably be better to try the language out for oneself, and form one's own opinion, versus allowing known competitors and evangelists who are purposely spreading misinformation to shape one's mind. Just like it is common sense to not expect a used car dealer trying to make sales to give fair and honest opinions or assessments about competitor's cars.

> Or check what they have implemented versus promised.

Yes, totally agree that the best way is to check something out, and form one's own opinion. Also, these are free open-source languages that we are referring to. People are free to go to their GitHub and make suggestions, discuss, or join the effort to help implement whatever they feel is needed.


It delivers on everything listed on the website/docs. You can check for yourself.


I'm not an expert, but wouldn't garbage collection be a difficult problem as well?


It would have to include its own garbage collector, yes.


Does such a thing exist? I would love something like that, but is it even feasible? Isn’t there a lot more you need to be aware of, to make a translation of say TS’s objects into C?


These are far from perfect, but still something:

https://github.com/andrei-markeev/ts2c/

https://github.com/evanw/thinscript

If you aim for 32 bit microcontrollers then you can go with assemblyscript to wasm and then with wasm to C transpiller


They would likely have to severely restrict the range of supported types, for example `window` is likely impossible to compile meaningfully.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: