Is Google’s Carbon Programming language the Right Successor to C++?
For years, C++ has been the go-to language for high-performance systems programming. But with the rise of multicore processors and GPUs, the need for a language that can take advantage of parallelism has never been greater. Enter Carbon, Google’s answer to the problem. But is it the right successor to C++?
Google has been in the news a lot lately for their new programming language, Carbon. It’s being billed as the successor to C++, but is it really? Let’s take a closer look.
On the surface, Carbon and C++ have a lot in common. They’re both statically typed, object-oriented languages with a focus on performance. They both have a learning curve, but once you know them, you can write code that is both readable and maintainable. However, there are some key differences that make Carbon a more attractive option for modern programmers.
For one, Carbon is garbage collected. This means that you don’t have to worry about manually managing memory, which can be a pain in C++. Carbon also has better support for concurrency than C++. With the rise of multicore processors, this is an important consideration. Finally, Carbon has a more modern standard library than C++. This includes features like string interpolation and pattern matching that make common tasks easier to accomplish.
According to Terry Lambert, Carbon Programming language is probably not the successor of C++. His reason are:
“Single inheritance is a deal-breaker for me, even though the eC++ utilized by IOKit in macOS and iOS has the same restrictions.
Although it specifies stronger type enforcement, which would — in theory — also eliminate RTTI and the reflection, which eC++ has historically eliminated as well, it’s doing it via expression-defined typing, rather than explicitly eliminating it. I expect that it would also prevent use of dynamic_cast, although that’s not explicitly called out.
Let’s see if Linus approves of someone compiling the Linux kernel with Carbon, and then starting to add Carbon syntax code, into that port of Linux.”
On the surface, Carbon seems like a great choice to replace C++. It is designed to be more reliable and easier to use than C++. In addition, it is faster and can be used for a variety of applications. However, there are some drawbacks to using Carbon. First, it is not compatible with all operating systems. Second, it does not have all of the features of C++. Third, it is not as widely used as C++. Finally, it is still in development and has not been released yet.
These drawbacks may seem like deal breakers, but they don’t necessarily mean that Carbon is not the right successor to C++. First, while Carbon is not compatible with all operating systems, it is compatible with the most popular ones. Second, while it does not have all of the features of C++, it has the most important ones. Third, while it is not as widely used as C++, it is gaining popularity rapidly. Finally, while it is still in development, it is expected to be released soon.
What Is Carbon? Carbon is a statically typed systems programming language developed by Google. It is based on C++ and shares a similar syntax. However, Carbon introduces several new features that make it better suited for parallelism. For example, Carbon provides first-class support for threads and synchronization primitives. It also offers a number of built-in data structures that are designed for concurrent access. Finally, Carbon comes with a toolchain that makes it easy to build and debug parallel programs.
Why Was Carbon Created? Google’s primary motivation for developing Carbon was to improve the performance of its search engine. To do this, they needed a language that could take advantage of multicore processors and GPUs. C++ was not well suited for this purpose because it lacked support for threading and synchronization. As a result, Google decided to create their own language that would be purpose-built for parallelism.
Is Carbon The Right Successor To C++? In many ways, yes. Carbon addresses many of the shortcomings of C++ when it comes to parallelism. However, there are some drawbacks. First, Carbon is still in its infancy and lacks many of the features and libraries that have made C++ so popular over the years. Second, because it is designed specifically for parallelism, it may be less suitable for other purposes such as embedded systems programming or network programming. Overall, though, Carbon looks like a promising successor to C++ and is worth keeping an eye on in the future.
Conclusion: So, is Google’s new Carbon programming language the right successor to C++? We think that Google’s Carbon programming language has the potential to be a great successor to C++.
With its garbage collection, better support for concurrency, and modern standard library, Carbon has everything that today’s programmer needs.
It is designed to be more reliable and easier to use than its predecessor. In addition, it is faster and can be used for a variety of applications. However, there are some drawbacks to using Carbon that should be considered before making the switch from C++.
So if you’re looking for a new language to learn, we recommend giving Carbon a try.
Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms.
Some paradigms are concerned mainly with implications for the execution model of the language, such as allowing side effects, or whether the sequence of operations is defined by the execution model. Other paradigms are concerned mainly with the way that code is organized, such as grouping a code into units along with the state that is modified by the code. Yet others are concerned mainly with the style of syntax and grammar.
Common programming paradigms include:
imperative in which the programmer instructs the machine how to change its state,
procedural which groups instructions into procedures,
object-oriented which groups instructions with the part of the state they operate on,
declarative in which the programmer merely declares properties of the desired result, but not how to compute it
functional in which the desired result is declared as the value of a series of function applications,
logic in which the desired result is declared as the answer to a question about a system of facts and rules,
mathematical in which the desired result is declared as the solution of an optimization problem
reactive in which the desired result is declared with data streams and the propagation of change
Get 20% off Google Google Workspace (Google Meet) Standard Plan with the following codes: 96DRHDRA9J7GTN6 Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)
Leetcode and HackerRank coding tests don’t work in developer interviews.
Here’s the proof:
Research has shown that work sample tests are VERY effective at determining if someone will we a good fit for a job. But here’s the problem: Work sample tests require applicants to perform tasks or work activities that mirror the tasks employees perform on the job.
When was the last time you had to “reverse an integer” or “find the longest substring without repeating characters”. These types of tests don’t mirror the tasks that software developers perform on the job.
It’s like testing an architect by having them build a house out of playing cards. Leetcode problems are just brain teasers.
If you want to administer a work sample test, have them do a code review, build a tiny feature in your product, or read and explain some part of your product code. (Every developer knows 90% of your time is spent reading code.)
Overenthusiastic LLM use ended up in hold but they but A LOT of LLM related stuff into trial and assess which is interesting submitted by /u/impact_dryer [link] [comments]
How to find common elements in two unsorted arrays with sizes n and m avoiding double for loop?
Programmers, software engineers, coders, IT professionals, and software architects all face the common challenge of needing to find common elements in two unsorted arrays with sizes n and m. This can be a difficult task, especially if you don’t want to use a double for loop.
In this blog post, we will be discussing how to find common elements in two unsorted arrays with sizes n and m avoiding double for loop. We will be discussing various methods that can be used to solve this problem and comparing the time complexity of each method.
There are several ways that you can find common elements in two unsorted arrays with sizes n and m avoiding double for loop. One way is by using the hashing technique. With this technique, you can create a hash table for one of the arrays. Then, you can traverse through the second array and check if the element is present in the hash table or not. If the element is present in the hash table, then it is a common element. Another way that you can find common elements in two unsorted arrays with sizes n and m avoiding double for loop is by using the sorting technique. With this technique, you can sort both of the arrays first. Then, you can traverse through both of the arrays simultaneously and compare the elements. If the elements are equal, then it is a common element.
The first method we will discuss is linear search. This method involves iterating through both arrays and comparing each element. If the element is found in both arrays, it is added to the result array. The time complexity of this method is O(nm), where n is the size of the first array and m is the size of the second array.
The second method we will discuss is the HashMap method. This method involves creating a HashMap of all the elements in the first array. Then, we iterate through the second array and check if the elements are present in the HashMap. If they are, we add them to the result array. The time complexity of this method is O(n+m), where n is the size of the first array and m is the size of the second array.
Method 3: Sort and Compare Method
The third method we will discuss is the Sort and Compare Method. This method involves sorting both arrays using any sorting algorithm like merge sort or quick sort. Once both arrays are sorted, we compare each element of both arrays one by one until we find a match. If a match is found, we add it to our result array. The time complexity of this method is O(nlogn+mlogm), where n is the size of the first array and m is the size of the second array.
Get 20% off Google Google Workspace (Google Meet) Standard Plan with the following codes: 96DRHDRA9J7GTN6 Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)
The naïve algorithm for finding common elements in two unsorted arrays with sizes nn and mm is O(nm)O(nm), i.e. quadratic.
The algorithm for sorting an array is O(nlogn)O(nlogn), and you can find common elements in two sorted arrays in O(n+m)O(n+m). In other words, for large enough arrays, it is significantly faster to first sort them, then look for the common elements, because the sorting algorithm will dominate the complexity, so your final algorithm ends up at O(nlogn)O(nlogn) as well.
Conclusion:
In this blog post, we discussed how to find common elements in two unsorted arrays with sizes n and m avoiding double for loop. We discussed three different methods that can be used to solve this problem and compared their time complexities. We hope that this blog post was helpful in understanding how to solve this problem.
There are many different ways to find common elements in two unsorted arrays with sizes n and m avoiding double for loop. The most straight forward way is by using a double for loop but this approach is not very efficient. A more efficient way is by using a hash table which has a time complexity of O(n+m). This algorithm is faster because we only need to loop through one of the arrays. We can then use the values from that array to check if there are any duplicates in the second array. This approach also uses less memory because we are not creating a new list to store the common elements.
What are the Greenest or Least Environmentally Friendly Programming Languages?
Technology has revolutionized the way we live, work, and play. It has also had a profound impact on the world of programming languages. In recent years, there has been a growing trend towards green, energy-efficient languages such as C and C++. C++ and Rust are two of the most popular languages in this category. Both are designed to be more efficient than traditional languages like Java and JavaScript. And both have been shown to be highly effective at reducing greenhouse gas emissions. So if you’re looking for a language that’s good for the environment, these two are definitely worth considering.
The study below runs 10 benchmark problems in 28 languages [1]. It measures the runtime, memory usage, and energy consumption of each language. The abstract of the paper is shown below.
“This paper presents a study of the runtime, memory usage and energy consumption of twenty seven well-known software languages. We monitor the performance of such languages using ten different programming problems, expressed in each of the languages. Our results show interesting findings, such as, slower/faster languages consuming less/more energy, and how memory usage influences energy consumption. We show how to use our results to provide software engineers support to decide which language to use when energy efficiency is a concern”. [2]
According to the “paper,” in this study, they monitored the performance of these languages using different programming problems for which they used different algorithms compiled by the “Computer Language Benchmarks Game” project, dedicated to implementing algorithms in different languages.
The team used Intel’s Running Average Power Limit (RAPL) tool to measure power consumption, which can provide very accurate power consumption estimates.
Get 20% off Google Google Workspace (Google Meet) Standard Plan with the following codes: 96DRHDRA9J7GTN6 Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)
The research shows that several factors influence energy consumption, as expected. The speed at which they are executed in the energy consumption is usually decisive, but not always the one that runs the fastest is the one that consumes the least energy as other factors enter into the power consumption equation besides speed, as the memory usage.
Energy
From this table, it is worth noting that C, C++and Java are among the languages that consume the least energy. On the other hand, JavaScript consumes almost twice as much as Java and four times what C consumes. As an interpreted language, Python needs more time to execute and is, therefore, one of the least “green” languages, occupying the position of those that consume the most energy.
Time:
The results are similar to the energy expenditure; the faster a programming language is, the less energy it expends.
Memory
In terms of memory consumption, we see how Java has become one of the most memory-consuming languages along with JavaScript.
To conclude:
Most Environmentally Friendly Languages: C, Rust, and C++ Least Environmentally Friendly Languages: Ruby, Python, Perl
Although this study may seem curious and without much practical application, it may help design better and more efficient programming languages. Also, we can use this new parameter in our equation when choosing a programing language.
This parameter can no longer be ignored in the future or almost the present; besides, the fastest languages are generally also the most environmentally friendly.
If you’re interested in something that is both green and energy efficient, you might want to consider the Groeningen Programming Language (GPL). Developed by a team of researchers at the University of Groningen in the Netherlands, GPL is a relatively new language that is based on the C and C++ programming languages. Python and Rust are also used in its development. GPL is designed to be used for developing energy efficient applications. Its syntax is similar to other popular programming languages, so it should be relatively easy for experienced programmers to learn. And since it’s open source, you can download and use it for free. So why not give GPL a try? It just might be the perfect language for your next project.
Top 10 Caveats – Counter arguments:
#1 C++ will perform better than Python to solve some simple algorithmic problems. C++ is a fairly bare-bone language with a medium level of abstraction, while Python is a high-level languages that relies on many external components, some of which have actually been written in C++. And of course C++ will be efficient than C# to solve some basic problem. But let’s see what happens if you build a complete web application back-end in C++.
#2: This isn’t much useful. I can imagine that the fastest (performance-wise) programming languages are greenest, and vice versa. However, running time is not only the factor here. An engineer may spend 5 minutes writing a Python script that does the job pretty well, and spends hours on debugging C++ code that does the same thing. And the performance difference on the final code may not differ much!
#3: Has anyone actually taken a look at the winning C and Rust solutions? Most of them are hand-written assembly code masked as SSE intrinsic. That is the kind of code that only a handful of people are able to maintain, not to mention come up with. On the other hand, the Python solutions are pure Python code without a trace of accelerated (read: written in Fortran, C, C++, and/or Rust) libraries like NumPy used in all sane Python projects.
#4: I used C++ years ago and now use Python, for saving energy consumption, I turn off my laptop when I got off work, I don’t use extra monitors, my AC is always set to 28 Celsius degree, I plan to change my car to electrical one, and I use Python.
#5: I disagree. We should consider the energy saved by the products created in those languages. For example, a C# – based Microsoft Teams allows people to work remotely. How much CO2 do we save that way? 😉
Now, try to do the same in C.
#6 Also, some Python programs, such as anything using NumPy, spend a considerable fraction of their cycles outside the Python interpreter in a C or C++ library..
I would love to see a scatterplot of execution time vs. energy usage as well. Given that modern CPUs can turbo and then go to a low-power state, a modest increase of energy usage during execution can pay dividends in letting the processor go to sleep quicker.
An application that vectorized heavily may end up having very high peak power and moderately higher energy usage that’s repaid by going to sleep much sooner. In the cell phone application processor business, we called that “race to sleep.” By Joe Zbiciak
#7 By Tim Mensch : It’s almost complete garbage.
If you look at the TypeScript numbers, they are more than 5x worse than JavaScript.
This has to mean they were running the TypeScript compiler every time they ran their benchmark. That’s not how TypeScript works. TypeScript should be identical to JavaScript. It is JavaScript once it’s running, after all.
Given that glaring mistake, the rest of their numbers are suspect.
I suspect Python and Ruby really are pretty bad given better written benchmarks I’ve seen, but given their testing issues, not as bad as they imply. Python at least has a “compile” phase as well, so if they were running a benchmark repeatedly, they were measuring the startup energy usage along with the actual energy usage, which may have swamped the benchmark itself.
PHP similarly has a compile step, but PHP may actually run that compile step every time a script is run. So of all of the benchmarks, it might be the closest.
I do wonder if they also compiled the C and C++ code as part of the benchmarks as well. C++ should be as optimized or more so than C, and as such should use the same or less power, unless you’re counting the compile phase. And if they’re also measuring the compile phase, then they are being intentionally deceptive. Or stupid. But I’ll go with deceptive to be polite. (You usually compile a program in C or C++ once and then you can run it millions or billions of times—or more. The energy cost of compiling is miniscule compared to the run time cost of almost any program.)
I’ve read that 80% of all studies are garbage. This is one of those garbage studies.
#8 By Chaim Solomon: This is nonsense
This is nonsense as it runs low-level benchmarks that benchmark basic algorithms in high-level languages. You don’t do that for anything more than theoretical work.
Do a comparison of real-world tasks and you should find less of a spread.
Do a comparison of web-server work or something like that – I guess you may find a factor of maybe 5 or 10 – if it’s done right.
Don’t do low-level algorithms in a high-level language for anything more than teaching. If you need such an algorithm – the way to do it is to implement it in a library as a native module. And then it’s compiled to machine code and runs as fast as any other implementation.
It’s worse than nonsense. TypeScript complies directly to JavaScript, but gets a crazy worse rating somehow?!
#10 By Tim Mensch
For NumPy and machine learning applications, most of the calculations are going to be in C.
The world I’ve found myself in is server code, though. Servers that run 24/7/365.
And in that case, a server written in C or C++ will be able to saturate its network interface at a much lower continuous CPU load than a Python or Ruby server can. So in that respect, the latter languages’ performance issues really do make a difference in ongoing energy usage.
But as you point out, in mobile there could be an even greater difference due to the CPU being put to sleep or into a low power mode if it finishes its work more quickly.
What is the single most influential book every Programmers should read
There are a lot of books that can be influential to programmers. But, what is the one book that every programmer should read? This is a question that has been asked by many, and it is still up for debate. However, there are some great contenders for this title. In this blog post, we will discuss three possible books that could be called the most influential book for programmers. So, what are you waiting for? Keep reading to find out more!
What are the concepts every Java C# C++ Python Rust programmer must know?
Ok…I think this is one of the most important questions to answer. According to the my personal experience as a Programmer, I would say you must learn following 5 universal core concepts of programming to become a successful Java programmer.
(1) Mastering the fundamentals of Java programming Language – This is the most important skill that you must learn to become successful java programmer. You must master the fundamentals of the language, specially the areas like OOP, Collections, Generics, Concurrency, I/O, Stings, Exception handling, Inner Classes and JVM architecture.
Get 20% off Google Google Workspace (Google Meet) Standard Plan with the following codes: 96DRHDRA9J7GTN6 Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)
(2) Data Structures and Algorithms – Programming languages are basically just a tool to solve problems. Problems generally has data to process on to make some decisions and we have to build a procedure to solve that specific problem domain. In any real life complexity of the problem domain and the data we have to handle would be very large. That’s why it is essential to knowing basic data structures like Arrays, Linked Lists, Stacks, Queues, Trees, Heap, Dictionaries ,Hash Tables and Graphs and also basic algorithms like Searching, Sorting, Hashing, Graph algorithms, Greedy algorithms and Dynamic Programming.
(3) Design Patterns – Design patterns are general reusable solution to a commonly occurring problem within a given context in software design and they are absolutely crucial as hard core Java Programmer. If you don’t use design patterns you will write much more code, it will be buggy and hard to understand and refactor, not to mention untestable and they are really great way for communicating your intent very quickly with other programmers.
(4) Programming Best Practices – Programming is not only about learning and writing code. Code readability is a universal subject in the world of computer programming. It helps standardize products and help reduce future maintenance cost. Best practices helps you, as a programmer to think differently and improves problem solving attitude within you. A simple program can be written in many ways if given to multiple developers. Thus the need to best practices come into picture and every programmer must aware about these things.
(5) Testing and Debugging (T&D) – As you know about the writing the code for specific problem domain, you have to learn how to test that code snippet and debug it when it is needed. Some programmers skip their unit testing or other testing methodology part and leave it to QA guys. That will lead to delivering 80% bugs hiding in your code to the QA team and reduce the productivity and risking and pushing your project boundaries to failure. When a miss behavior or bug occurred within your code when the testing phase. It is essential to know about the debugging techniques to identify that bug and its root cause.
I hope these instructions will help you to become a successful Java Programmer. Here i am explain only the universal core concepts that you must learn as successful programmer. I am not mentioning any technologies that Java programmer must know such as Spring, Hibernate, Micro-Servicers and Build tools, because that can be change according to the problem domain or environment that you are currently working on…..Happy Coding!
Summary: There’s no doubt that books have had a profound influence on society and the advancement of human knowledge. But which book is the most influential for programmers? Some might say it’s The Art of Computer Programming, or The Pragmatic Programmer. But I would argue that the most influential book for programmers is CODE: The Hidden Language of Computer Hardware and Software. In CODE, author Charles Petzold takes you on a journey from the basics of computer hardware to the intricate workings of software. Along the way, you learn how to write code in Assembly language, and gain an understanding of how computers work at a fundamental level. If you’re serious about becoming a programmer, then CODE should be at the top of your reading list!
I’ve always been fascinated by programming languages because I work as a software developer. These are the instruments we employ in order…Continue reading on Medium »
Explore validating Shiny for Python dashboards with Playwright. Ensure reliable data analysis through end-to-end testing.Continue reading on Appsilon »
Circle’s Web3 Services offer a suite of tools designed to streamline development within the Web3 space. One of the most exciting offerings…Continue reading on Medium »
You can also view the whole project in stackblitz https://stackblitz.com/edit/js-otpixp?devToolsHeight=33&embed=1&file=index.js&theme=darkContinue reading on Medium »
I’m learning about Object-Oriented Programing(OOP) and data structure by python. Python doesn’t have primate type. Its like class or…Continue reading on Medium »
In the realm of Artificial Intelligence development, the phrase “It’s just code, right?” often oversimplifies the intricate journey…Continue reading on Crayon Data & AI »
Hi, I am a recent Artificial Intelligence Engineering graduate, and my goal is to reveal all facets of Artificial Intelligence. Today, I…Continue reading on Medium »
In this blog post, I will show you how to create word clouds using Python and a few powerful libraries. Word clouds are a popular way to…Continue reading on Medium »
I got tired of going on TradingView and looking at lots of stocks to find just a few that match what I want. Since I’m a programmer and…Continue reading on Medium »
In the ever-evolving landscape of healthcare, medical coding and billing professionals play a crucial role in ensuring accurate…Continue reading on Medium »
GitHub Copilot, a code generation and autocomplete wizard developed by Microsoft and OpenAI in 2021, has been widely adopted by the…Continue reading on Enrique Dans »
Overenthusiastic LLM use ended up in hold but they but A LOT of LLM related stuff into trial and assess which is interesting submitted by /u/impact_dryer [link] [comments]
Hello fellow programs! tl;dr what should r/programming's rules be? And also a call for additional mods. We'll leave this stickied for a few days to gather feedback. Here are the broad categories of content that we see, along with whether they are currently allowed. ✅ means that it's currently allowed, 🚫 means that it's not currently allowed, ⚠️ means that we leave it up if it is already popular but if we catch it young in its life we do try to remove it early. ✅ Actual programming content. They probably have actual code in them. Language or library writeups, papers, technology descriptions. How an allocator works. How my new fancy allocator I just wrote works. How our startup built our Frobnicator, rocket ship emoji. For many years this was the only category of allowed content. ✅ Programming news. ChatGPT can write code. A big new CVE just dropped. Curl 8.01 released now with Coffee over IP support. ✅ Programmer career content. How to become a Staff engineer in 30 days. Habits of the best engineering managers. How to deal with your annoying coworkers, Jeff. ✅ Articles/news interesting to programmers but not about programming. Work from home is bullshit. Return to office is bullshit. There's a Steam sale on programming games. Terry Davis has died. How to SCRUMM. App Store commissions are going up. How to hire a more diverse development team. Interviewing programmers is broken. ⚠️ General technology news. Google buys its last competitor. A self driving car hit a pedestrian. Twitter is collapsing. Oculus accidentally showed your grandmother a penis. Github sued when Copilot produces the complete works of Harry Potter in a code comment. Meta cancels work from home. Gnome dropped a feature I like. How to run Stable Diffusion to generate pictures of, uh, cats, yeah it's definitely just for cats. A bitcoin VR metaversed my AI and now my app store is mobile social local. 🚫 Politics. The Pirate Party is winning in Sweden. Please vote for net neutrality. Big Tech is being sued in Europe for gestures broadly. 🚫 Gossip. Richard Stallman switches to Windows. Elon Musk farted. Linus Torvalds was a poopy-head on a mailing list. Grace Hopper Conference is now 60% male. The People's Rust Foundation is arguing with the Rust Foundation For The People. Terraform has been forked into Terra and Form. Stack Overflow sucks now. Stack Overflow is good actually. ✅ Demos with code. I wrote a game, here it is on GitHub 🚫 Demos without code. I wrote a game, come buy it! Please give me feedback on my startup (totally not an ad nosirree). I stayed up all night writing a commercial text editor, here's the pricing page. I made a DALL-E image generator. I made the fifteenth animation of A* this week, here's a GIF. 🚫 AskReddit type forum questions. What's your favourite programming language? Tabs or spaces? Does anyone else hate it when. 🚫 Support questions. How do I write a web crawler? How do I get into programming? Where's my missing semicolon? Please do this obvious homework problem for me. Personally I feel very strongly about not allowing these because they'd quickly drown out all of the actual content I come to see, and there are already much more effective places to get them answered anyway. In real life the quality of the ones that we see is also universally very low. 🚫 Surveys and 🚫 Job postings and anything else that is looking to extract value from a place a lot of programmers hang out without contributing anything itself. 🚫 Meta posts. DAE think r/programming sucks? Why did you remove my post? Why did you ban this user that is totes not me I swear I'm just asking questions. Except this meta post. This one is okay because I'm a tyrant that the rules don't apply to (I assume you are saying about me to yourself right now). 🚫 Images, memes, anything low-effort or low-content. Thankfully we very rarely see any of this so there's not much to remove but like support questions once you have a few of these they tend to totally take over because it's easier to make a meme than to write a paper and also easier to vote on a meme than to read a paper. ⚠️ Posts that we'd normally allow but that are obviously, unquestioningly super low quality like blogspam copy-pasted onto a site with a bazillion ads. It has to be pretty bad before we remove it and even then sometimes these are the first post to get traction about a news event so we leave them up if they're the best discussion going on about the news event. There's a lot of grey area here with CVE announcements in particular: there are a lot of spammy security "blogs" that syndicate stories like this. ⚠️ Posts that are duplicates of other posts or the same news event. We leave up either the first one or the healthiest discussion. ⚠️ Posts where the title editorialises too heavily or especially is a lie or conspiracy theory. Comments are only very loosely moderated and it's mostly 🚫 Bots of any kind (Beep boop you misspelled misspelled!) and 🚫 Incivility (You idiot, everybody knows that my favourite toy is better than your favourite toy.) However the number of obvious GPT comment bots is rising and will quickly become untenable for the number of active moderators we have. There are some topics such as Code of Conduct arguments within projects that I don't know where to place where we've been doing a civility check on the comments thread and using that to make the decision. Similarly some straddle the line (a link to a StackOverflow post asking for help and the reddit OP is the StackOverflow OP, but there's a lot of technical content and the reddit discussion is healthy). And even most 🚫s above are left up if there's a healthy discussion going already by the time we see it. So what now? We need to decide what r/programming should be about and we need to write those rules down so that mods can consistently apply them. The rules as written are pretty vague and the way we're moderating in practise is only loosely connected to them. We're looking for feedback on what kind of place r/programming should be so tell us below. We need additional mods. If you're interested in helping moderate please post below, saying why you'd be a good mod and what you'd would change about the space if you were. You don't need to be a moderator elsewhere but please do mention it if you are and what we could learn on r/programming that you already know. Currently I think I'm the only one going down the new page every morning and removing the rule-breaking posts. (Today these are mostly "how do I program computer" or "can somebody help me fix my printer", and obvious spam.) This results in a lot of threads complaining about the moderation quality and, well, it's not wrong. I'm not rigorously watching the mod queue and I'm not trawling comments threads looking for bad actors unless I'm in that thread anyway and I don't use reddit every single day. So if we want it to be better we'll need more human power. FAQ: Why do we need moderation at all? Can't the votes just do it? We know there is demand for unmoderated spaces in the world, but r/programming isn't that space. This is our theory on why keeping the subreddit on topic is important: Forums have the interesting property that whatever is on the front page today is what will be on the front page tomorrow. When a user comes to the site and sees a set of content, they believe that that's what this website is about. If they like it they'll stay and contribute that kind of content and if they don't like it they won't stay, leaving only the people that liked the content they saw yesterday. So the seed content is important and keeping things on topic is important. If you like r/programming then you need moderation to keep it the way that you like it (or make it be the place you wish it were) because otherwise entropic drift will make it be a different place. And once you have moderation it's going to have a subjective component, that's just the nature of it. Because of the way reddit works, on a light news day r/programming doesn't get enough daily content for articles to meaningfully compete with each other. Towards the end of the day if I post something to r/programming it will immediately go to the front page of all r/programming subscribers. So while it's true that sub-par and rule-breaking posts already do most of their damage before the mods even see them, the whole theory of posts competing via votes alone doesn't really work in a lower-volume subreddit. Because of the mechanics of moderation it's not really possible to allow the subreddit to be say 5% support questions. Even if we wanted to allow it to be a small amount of the conten, the individuals whose content was removed would experience and perceive this as a punitive action against them. That means that any category we allow could theoretically completely take over r/programming (like the career posts from last week) so we should only allow types of content that we'd be okay with taking it over. Personally my dream is for r/programming to be the place with the highest quality programming content, where I can go to read something interesting and learn something new every day. That dream is at odds with allowing every piece of blogspam and "10 ways to convince your boss to give you a raise, #2 will get you fired!" submitted by /u/ketralnis [link] [comments]
What are Programming Languages used for Autopilot in Self Driving Cars like Tesla, Audi, BMW, Mercedes Benz, Volvo, Infiniti?
Most self-driving cars on the market today use C programming language for their vehicle software. This is because C is a very robust and stable language that can be trusted for mission-critical applications. In addition, C is relatively easy to learn and has a wide range of features that make it well suited for automotive applications. However, there are some drawbacks to using C for self-driving cars. First, it is not a very concise language, so the code can be quite long and difficult to read. Second, C does not have built-in support for object-oriented programming, which is becoming increasingly important in the world of autonomous vehicles. As a result, many carmakers are starting to explore other languages for their autopilot systems, such as Java and Python.
Whilst it’s technically correct that Tesla most likely uses the C programming language for their vehicle software, it’s worth clarifying that the actual language would be MISRA C which has several constraints on the language to provide better control over its features .
Low-level communication requires using C. Especially for embedded systems, sensors and IoT software.
To develop software for supporting devices in the system C++ is the best option.
Get 20% off Google Google Workspace (Google Meet) Standard Plan with the following codes: 96DRHDRA9J7GTN6 Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)
However, Python is the language to enter the game when it comes to using AI.
WHY DOES ELON HATE LIDAR?
There are a few reasons for that:
Lidar uses light to measure distances. But we know you can measure distances using a “stereo pair” of regular cameras with (by 2020 standards) very simple software processing.
Lidar requires mechanical scanning of the scene – implying moving parts that will make it less reliable.
Lidar sensors are quite costly compared to cameras. A digital camera costs less than $1 in quantity. Lidar units are in the hundred to several hundred dollar range.
Radar and ultrasound both do a lot of what Lidar does – they are cheaper, and because they’re operating outside of the spectrum of visible light, they can see things that cameras and Lidar can’t – so they add more value than Lidar.
Lidar does have a few odd “artifacts” – some objects don’t reflect light very well – very shiny objects reflect it only in a narrow direction that doesn’t return the light to the Lidar sensor. Processing to eliminate these artifacts is comparable in complexity to the stereo-camera solution.
Lidar can’t REPLACE cameras – so you still need them for image recognition. For example, you can’t read the wording on a road sign using Lidar.
Waymo (previously Google) are using much more clever sophistication – and having a wider variety of sensors helps them. But with only a small number of actual cars collecting driving data – training an AI is tough. They’ve only driven about 20 million miles with their test cars.
Tesla are using brute force AI. They’ve invested in a massively powerful AI computer in each car (two of them, actually) – and a billion dollar data center for processing AI learning. With a million cars collecting data for them, they can collect a BILLION miles of training data every month.
With the Tesla approach, less is more.
With the Waymo approach, sophistication is king – and the more data you can get from your sensors, the less processing you have to do.
Programming languages are used for Autopilot in Self Driving Cars. These cars have software that uses the C programming language. The MISRA C standard is important for the quality of this software. There are some core features of Autopilot, such as adaptive cruise control, lane centering, and autonomous parking. Some cars also have other advanced features that add to the convenience of the driver. Drivers can get these features by either buying a car with them included or by installing aftermarket Autopilot systems. Programming languages are also used for other purposes in these cars. For example, some companies use different languages to develop their infotainment systems or autonomous driving systems. Additionally, some companies have open-source projects for their vehicle software where they allow anyone to contribute code. Programming languages are thus an integral part of self-driving cars.
Programming languages are used to give instructions to a computer. High-level programming languages are easier for humans to read and write than low-level languages, which are closer to machine code. Programming languages can be compiled or interpreted. A Compiled language is converted into machine code that the computer can understand before the program is run. An interpreted language is read by a software program called an interpreter, which then converts it into machine code that the computer can understand. Some programming languages are more suited to certain tasks than others. For example, FORTRAN is often used for scientific or engineering applications because its syntax is designed to produce code that is easy to read and understand. Finding the right programming language can be a challenging task for any programmer. When it comes to writing software for self-driving cars, there are a few important factors to consider. First, the language must be able to handle the large amounts of data that self-driving cars generate. Second, it must be able to handle the real-time processing requirements of autonomous vehicles. And third, it must be able to meet the safety requirements of the automotive industry.
I doubt it could operate well in the complete absence of light, but that situation can not arise. And it works extremely well in at least one very difficult seeing situation. Let me relate my experience.
On our recent road trip from San Diego to Clinton, Iowa, it was near dark as we reached the city limits of Clinton. Just as we did it started to rain heavily. A few seconds later the sky opened up and the heavy rain became what we call in Iowa, a Gully Washer. I was using Navigate on Autopilot, driving on the main road which led to the side street where our hotel destination was situated. I could see through the windshield by watching a 2 inch wide strip of cleared glass created as the windshield wiper passed back and forth. Other cars kept going and as I couldn’t see the road, I followed the car ahead of me. (Autopilot made that much easier than trying to stop as it even kept within the lane pretty much.) I could not see but I guess the cameras on the bumper below the headlights could see well enough. When the navigator told me to turn left in 200 feet, I couldn’t do that because I couldn’t see at all out the side window or the corner of the windshield. That is, nothing but flowing water, so I continued, to which Autopilot directed me to make a U-turn. On returning to the intersection of my turn, I caught a glimpse of a street sign and so, moving very slowly, turned around the sign. Water was flowing at least 6″ deep across the intersection but after a 50 or 100 feet, the crown of the road emerged and I realized that the rain was letting up.
We made it to the hotel parking lot which was full, shoes soaked getting into the door, and after checking in, waited the storm out which didn’t take long.
The point of this whole story is that the Tesla Autopilot will never have the opportunity to operate in the dark. The headlights provide enough light for the autopilot which can (in this case) see much better than a human driver. And if the battery is down to where the lights go out, I doubt the car will drive very far anyway.
Autopilot-like functions are becoming more and more mainstream as technology improves. By late 2022, most car manufacturers will be offering some sort of more advanced self-driving capabilities.
What’s Important to Know When Evaluating
When evaluating autopilot-like self driving systems, the main thing to look out for is Adaptive Cruise Control (ACC) and whether it handles starting and stopping at all speeds and on what kinds of roads. Then learn how well the vehicle can identify roads and stay in the center of the lane, called Lane Centering. Most manufacturers tout “Lane Keeping Assist” (LKA) as a way to help automate steering, but that’s different from Lane Centering and often a far cry from something like Tesla’s Autopilot system or Cadillac’s Super Cruise that are able to stay steadily centered in the lanes while driving.
If you’re not sure, check out videos on YouTube – enthusiasts and professionals often test out the systems to provide their opinions and real-world examples.
Also, ask the dealer how the system can be updated since technology and software changes so quickly. In Tesla’s case, the Autopilot system is continually updated over-the-air with software updates. Most other auto manufacturers require the updates to occur at the dealer during regular service updates.
Is it good useful meaningful worthwhile to use register variables in C++?
The register keyword has been largely ignored by compilers for decades. In C, it prevents you from taking the address of a variable. But otherwise, most compilers ignore the hint it offers.
STANDARD C++ does not support register variables in 2022. In C register variables serve as a hint to the compiler to use a register rather than a memory address. Prior to C++17, it could also be used as a hint to the compiler in C++ as well, but only some conforming compilers did anything as a result. Starting in C++17, register has become an unused but reserved keyword.
Some compilers still permit it and some may even honor the request. Your programs, however, will not be cross-platform or written in true, standards-compliant C++ if you use the register keyword.
NOTE:
The situation in C (as opposed to C++) is quite different.
Get 20% off Google Google Workspace (Google Meet) Standard Plan with the following codes: 96DRHDRA9J7GTN6 Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more codes)
Usually the answer to that question is that it’s the wrong question, and that you should instead ask “Is it useful/meaningful/worthwhile…?” For example, if you had asked about using the register keyword in C, I would say “There’s nothing wrong about it. It won’t harm your program. It’s just a waste of time.”
It turns out C++ deprecated the register keyword in C++11, and removed it in C++17. As of C++17, the keyword register is now a reserved word with no meaning.
So, the answer to “is it good?” is “No.” Your program will fail to compile as a C++17 program.
By the end of 90s, register was the “R-type” decal of the C programming world. It did about as much for the speed of your program as the decal did for your car. (Possible exception for weak compilers on some embedded platforms.)
In any case, it doesn’t make sense to have a register qualifier on a parameter in a function prototype. It is ignored on any function declaration that is not a definition, similar to top level const.
Now, both of those are meaningful in a definition. The register keyword stops you from taking an address (in C, but not C++), and const stops you from mutating the variable.
void foo(register const int x) {
const int *px = &x; // ERROR
x = 42; // ERROR
}
So, in principle you should be able to delete the unnecessary and useless register keywords from.the prototypes in the header without affecting any aspect of the program’s speed or correctness.
It was a hint to the compiler that a variable would be frequently accessed and the the compiler should prefer to use a CPU register to hold it. The downside being you can’t take the address of a register.
In days of yore (pre-millennium) on now arcane and primitive architectures significant improvements could be had from making (typically) the control variable of a for-loop as a register.
I’m sure that’s still true of some embedded platforms. But modern CPUs have multiple tiers of memory cache and the overhead of loading from and storing variables to main memory is less significant.
We no longer really live with the simplistic Von Neumann of CPU and Main Memory with nothing in between.
Also, optimizers have vastly improved and will tend to make good choices for storage on their own.
It was removed from the standard not because its use was doing harm but that it was regarded as having little practical value and the keyword may be useful in the future.
submitted by /u/Unusual-State1827 [link] [comments]
Today I Learned (TIL) You learn something new every day; what did you learn today? Submit interesting and specific facts about something that you just found out here.
Reddit Science This community is a place to share and discuss new scientific research. Read about the latest advances in astronomy, biology, medicine, physics, social science, and more. Find and submit new publications and popular science coverage of current research.