Daniele
Daniele
something stupid like checkboxes for each pack
Daniele
:)
:)
Nazarova Muslibar
Nazarova Muslibar
Nazarova Muslibar
Nazarova Muslibar
Which program is better for writing code in C ++
Murod
艾丁森
my c project needs to link libstdc++ for some reason, is it okay?
J
your c project is a c++ project
J
what are your dependencies?
J
how are you building your application/library?
艾丁森
So I have to link libstdc++ in the c project
艾丁森
I can't link libstdc++ staticly to the c++ project, i don't know y
J
hmm... is that dependency a single library, or two libs, where one is the C functions, and the other is the C++ stuff?
J
also, its a bit weird for a C++ lib to provide a C interface rather than the other way around
艾丁森
J
yeah, that's a C++ library and that's it.
艾丁森
艾丁森
I wonder whether it is normal that linking libstdc++ in a c project
J
a C library that provides a C++ interface on the side
J
it's absolutely not.
J
if you're linking in libstdc++, you're either doing something wrong, or you're writing C++ like C
艾丁森
I can't provide c interfaces in a c++ lib?
J
sure, but that means that it will then need to be provided a C++ runtime in deployment anyway, so it doesn't make a lot of sense
J
if you can provide that, then why not just use C++. it'd be hella more beneficial (excluding the Linux kernel, as an example)
艾丁森
艾丁森
they can just load library and call those functions' names
J
uhh, sure, but that depends a lot tho. in this scenario, you're describing a library in C++, that provides a C interface, which is then called, over some FFI presumably, by another language runtime. that'd be 3 different executors at least
J
i've not really seen that happen, and what's more likely is you'll have an implementation in C (maybe even some sweet, sweet, per platform optimizations), providing bindings to other languages, including C++
艾丁森
so I can't fake this c++ implementation as a c implementation?
J
no, nor should you.
J
what library are you talking about? can you link to its repo?
Anonymous
please anyone help me out in this program
艾丁森
i write it myself actually
J
what's the front-end written in?
艾丁森
艾丁森
don't you know web ? running in browser
J
no, i do embedded systems mainly, and im asking if it's running on an environment like nodejs, or some random concoction you've made, or on the client system?
艾丁森
running in browsers. should i compile them to wasm?
J
yeah, that'd be more adequate. im no authority or even a knowledgable person on this, but if you intend the javascript to run on the client, and it needs that C++ lib to be there as well - i'd say dont have a lot of options
J
either deliver as wasm or rewrite it in javascript
艾丁森
it also runs in a linux server
艾丁森
linux and web browser...
J
okay, hold on. which part of that whole application stack needs that C++ library?
艾丁森
none
艾丁森
It just I have already write it in c++
J
none
you will need to then rephrase your questions. you're not making a lot of sense.
J
艾丁森
so I should rewrite it in c
艾丁森
damn it , i was an idiot
J
why do you need it in C or C++, if none of your javascript stuff needs it?
艾丁森
sorry
艾丁森
I read your message wrong
艾丁森
both linux server and web browser needs that c++ library
艾丁森
I thought you ask why I write it in c++ before
J
as for rewriting it into javascript... it depends. easier to manage, i suppose - none of the c/c++/wasm magic; but then it's a trade-off of finding adequate replacements for functionality and if the performance is even acceptable
Alex
Alex
also we don`t have any info about performance requirements
J
yeah, that'd be outside my scope. i dont deal in developing for web, but afaik, it's super awesome these days. not sure what versions of browsers are actually in use by user share, and whether wasm is supported/enabled on 'em.
J
again, i'd not go that route if i really dont need to, purely out of having less things to manage (if i can have all of the app in one language, that's a huge gain in reduced complexity)
Alex
Alex
easier to use http wrapper for existing c++ lib I suppose
艾丁森
I decide to rewrite it in c
J
like i said - i dont write for web. maybe when i'll start wearing my rust hat, i'll go and start touching wasm
Anonymous
J
he has a lib that's in C++ and exports C-like function interfaces. he was asking why his C application was now linking libstdc++