Question to Lanes users: Is C++ a problem for you?

114 views
Skip to first unread message

Benoit Germain

unread,
Mar 15, 2024, 12:03:33 PM3/15/24
to lu...@googlegroups.com
Hello,

If I remember well, Lua itself is written in "Clean C 99", or something approaching.
Currently, to follow on that trend, Lanes is implemented in C as well.
Are there some environments where Lanes is used, and C++ is not available?
Such environments could just stick to the latest Lanes C implementation, but then, I'd have less qualms about doing the swap if I was reasonably sure the change won't be a problem and they still could benefit from future fixes/features, if any, without me having to maintain two branches.
So, Lanes users, what would be the impact of the switch on you?

Regards,


--
Benoit.

Sainan

unread,
Mar 15, 2024, 6:05:18 PM3/15/24
to lu...@googlegroups.com
I think the question you have to ask yourself is if:
1. The kinds of users that don't have access to C++ even have a use-case
for Lanes.
2. It's worth it for you to stick with a language that makes it harder
for you to develop and iterate in.
> --
> You received this message because you are subscribed to the Google
> Groups "lua-l" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lua-l+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lua-l/CAAnJQcYjcy6UhmzBF_DPmmqgp%2BQrBtRv8Zh2FovTj%3DcXwC6B5w%40mail.gmail.com
> [1].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/lua-l/CAAnJQcYjcy6UhmzBF_DPmmqgp%2BQrBtRv8Zh2FovTj%3DcXwC6B5w%40mail.gmail.com?utm_medium=email&utm_source=footer

Benoit Germain

unread,
Mar 16, 2024, 4:41:48 AM3/16/24
to lu...@googlegroups.com
One of the advantages of using C++ would be to use std::thread instead of os-specific implementations (one being based on pthread). Desktop OS are not problematic, but, maybe, someone somewhere is using Lua+Lanes on some embedded system where pthread is available but C++ isn't. I suppose it would be pretty niche anyway...



--
Benoit.

Sainan

unread,
Mar 16, 2024, 1:25:13 PM3/16/24
to lu...@googlegroups.com
I guess you could try announcing your intention to move to C++, and if
there are any such users, I'm sure they'd quickly get in touch, if they
find it important enough.
> https://groups.google.com/d/msgid/lua-l/CAAnJQcZT%3D_soDGy39FxXAhS0etBFJaDaL3iagkwX%3DoMQ7S%2BVew%40mail.gmail.com
> [1].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/lua-l/CAAnJQcZT%3D_soDGy39FxXAhS0etBFJaDaL3iagkwX%3DoMQ7S%2BVew%40mail.gmail.com?utm_medium=email&utm_source=footer

Benoit Germain

unread,
Mar 17, 2024, 12:42:30 PM3/17/24
to lu...@googlegroups.com
It's exactly what I am doing presently :-). My other option would be to open an issue on Github, but I'm not sure Lanes users would see it unless they happen to visit the site. At least here I hope a representative fraction of the users are subscribed to this list.



--
Benoit.

Michael Lenaghan

unread,
Mar 17, 2024, 1:41:50 PM3/17/24
to lu...@googlegroups.com
Just to make sure there are no surprises: C++ is not a superset of C; they’re different languages.

Here’s a Wikipedia page that describes some of the differences:


It says:

"However, C is not a subset of C++, and nontrivial C programs will not compile as C++ code without modification. Likewise, C++ introduces many features that are not available in C and in practice almost all code written in C++ is not conforming C code. This article, however, focuses on differences that cause conforming C code to be ill-formed C++ code, or to be conforming/well-formed in both languages but to behave differently in C and C++."

Sainan

unread,
Mar 17, 2024, 6:25:50 PM3/17/24
to lu...@googlegroups.com
On 2024-03-17 18:41, Michael Lenaghan wrote:
> Just to make sure there are no surprises: C++ is not a superset of C;
> they’re different languages.

Eh, C++ not having `restrict` or whatever is no reason for panic. The
few differences there are can easily be mitigated with macros.

bil til

unread,
Mar 18, 2024, 1:46:49 AM3/18/24
to lu...@googlegroups.com
If you are programming micro-controllers, you typically use C compiler
from smaller companies than MS, or based on gnu, then the compiler
suppliers will typically strongly recommend to use the C++ compiler,
as this is just the "state-of-the-art" version. C compilers often do
not produce code as efficiently / safe as the C++ version of the
compiler.

But this is not a question of using C or C++, this is just a question
what compiler to use... .

C for coding of "third party software" ALWAYS has the advantage of
being much more understandable and clear for users (I assume that all
users looking into third party soucecode are knowing C pecularities
very well). (C can also be applied in nasty style, especially if
function tables are used extensively, but for God sake Lua C code uses
a very direct and "easy to debug" C coding style, thank you to the Lua
programmers for this... ).
> --
> You received this message because you are subscribed to the Google Groups "lua-l" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/lua-l/1086a6ba439c69fe1ab932f85c8496ba%40calamity.gg.
Reply all
Reply to author
Forward
0 new messages