LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-27-2022, 06:30 AM   #46
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,754

Rep: Reputation: Disabled

Well I guess a cluster of quantum computers could translate much faster than a programmer.
FWIW if someone told me about modern android specs 20 years ago, I'd probably think they are mad.
 
2 members found this post helpful.
Old 05-27-2022, 01:35 PM   #47
half-word
LQ Newbie
 
Registered: Jan 2012
Location: Split, Croatia
Distribution: LinuxMint, Ubuntu, Debian, Devuan (+FreeBSD)
Posts: 24

Rep: Reputation: Disabled
Quote:
Originally Posted by Jeebizz View Post
To each their own, but it always got in the way when typing and just is a nuisance.

This! Either it was too fast/sensitive , or then suddenly too slow and a pain to get to a window - for me it is worse than the touchpad, and least with that I can navigate somewhat better, if I don't have a mouse on hand. That orange thing is just fscking useless imo.
I actually find it a great boon for typing exactly because of its location. I don't have to move my fingers from the home row on the keyboard to click something. Mouse is the worst regarding that because I have to completely remove my hand from the keyboard to move it. Touchpad is closer, but it's not as precise as mouse AND trackpoint.

Quote:
Originally Posted by bassmadrigal View Post
This isn't exactly true. While the kernel does have tens of thousands of programmer years, you would not need to take all that time to translate the kernel to a new language. Many of the lines of code written in those thousands of years of coding have been removed/replaced/refactored, and you wouldn't need to recreate all the history of the kernel to get to a modern kernel.

We're still looking at an unfathomably long time to rewrite the kernel, but it would be at least an order of magnitude less than what it took to get to this point.
I believe the programmer years I quoted are actual for the current LoC count. And I doubt it would take less time to rewrite as a programmer must first read and understand the old code and only then write the new code.

Quote:
Originally Posted by elcore View Post
Well I guess a cluster of quantum computers could translate much faster than a programmer.
Actually, any computer could and already can do it. Whenever you compile the source the compiler produces machine code. Any compiler can be instructed not to compile all the way there but to generate (optimized) assembly code instead.

In fact, that way the entire operating system could be automatically rewritten to assembly without much effort. The new assembly code would be bulkier than handcrafted one, but for most code it wouldn't matter. Someone could profile the code and optimize for size and speed where necessary, but I guess 80-90% of automatically generated code would be fine. New makefiles should be made to assemble everything and that would be it.

Therefore the task is actually easier than it looks, but the main question still remains, why? Assembly code is harder to maintain and it is incompatible with different CPU architectures.
 
Old 05-28-2022, 12:20 AM   #48
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by half-word View Post
And I doubt it would take less time to rewrite as a programmer must first read and understand the old code and only then write the new code.
I wouldn't consider myself a real programmer, but when I do create my own scripts, I find developing the logic and getting that in code takes the longest amount of time. Since that's already done, I would think the time to translate from one language to another wouldn't take nearly as long as it took to originally develop the logic and write the code (provided they have a strong understanding of both languages).
 
1 members found this post helpful.
Old 05-28-2022, 05:30 AM   #49
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,754

Rep: Reputation: Disabled
Quote:
Originally Posted by half-word View Post
Actually, any computer could and already can do it. Whenever you compile the source the compiler produces machine code.
Sure it can, but if you read recent news from ibm; few years from now this translation could be done in miliseconds.
 
Old 05-29-2022, 02:32 AM   #50
1483_fourteeneightythree
LQ Newbie
 
Registered: May 2022
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by half-word View Post
Ok let's think in programmer years. Just Linux kernel already has tens of thousands of programmer years.

That means that to (re)write it, roughly one programmer would need to work tens of thousands of years. Or a team of tens of programmers would need a thousand years. Or a team of thousand programmers would work for decades. And so on.

That's just the kernel, imagine how many more lines of code the userland contains. The idea is completely bonkers.




Without that little wonder, I'd stop using ThinkPads.
People shouldn't be allowed to lie in Operating Systems forums or programming forums.
 
Old 05-29-2022, 02:33 AM   #51
1483_fourteeneightythree
LQ Newbie
 
Registered: May 2022
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bassmadrigal View Post
I wouldn't consider myself a real programmer, but when I do create my own scripts, I find developing the logic and getting that in code takes the longest amount of time. Since that's already done, I would think the time to translate from one language to another wouldn't take nearly as long as it took to originally develop the logic and write the code (provided they have a strong understanding of both languages).
I think the same as you.

Thanks for posting.
 
Old 05-29-2022, 05:04 AM   #52
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by 1483_fourteeneightythree View Post
I think the same as you.
Me thinking it would be a bit faster to rewrite code in a new language than writing it from scratch is by no means me believing that this project has any worth.

It would be a colossal waste of time for very little benefit. You're probably talking hundreds of thousands programmer years to rewrite the entirety of 15.0 to assembly... nobody is going to do that.
 
Old 05-29-2022, 05:20 AM   #53
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,593

Rep: Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459
Quote:
Originally Posted by 1483_fourteeneightythree View Post
People shouldn't be allowed to lie in Operating Systems forums or programming forums.
If this will happen, probably you will be quite soon banned for life - at least in this forum.

Honestly, I do not believe that you even have a vague idea of Assembler Programing. Not even a clue.

You are just amusing yourself showing us a crazy idea and/or you are a 10 years old. At least mentally.

Last edited by LuckyCyborg; 05-29-2022 at 05:33 AM.
 
3 members found this post helpful.
Old 05-29-2022, 08:56 AM   #54
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 167

Rep: Reputation: 157Reputation: 157
Having worked in a few programming languages - and having had to read and debug programs in a few that I do not typically write in - my opinion is that translating a program into a new language is often not the best approach.

The original program will have been written (hopefully!) to optimize the code using the constructs available in that language. A different language may have additional or different constructs that either 1) work better, or 2) make it much clearer what the code is trying to do. If you want maintainable code, then clear code is better than obfuscated code translated from a different language.

Ancient example: trying to translate matrix manipulation from arrays in FORTRAN to pointers in C. Or working with ancient FORTRAN code that only has DO loops, and realizing that much of it would be far better off in a language with for-while, or repeat-until or for-each-X-in structures. Better off understanding the original purpose of the code and re-writing it efficiently in the new language.

And compilers or interpreters try to optimize what they are working with as source. I expect they do a better job at optimizing code that is well-written in that language, rather than some bastardized attempt to make that language work the way that some other language works.

Of course, modern programs make extensive use of existing libraries, modules, widgets, etc. that are often coded in a completely different language.

My impression as a newbie here is that many of the participants speak more than one (verbal, not computer) language. When speaking in your second (or third, or fourth) language, do you speak more efficiently when you think in your first language and translate into the one you want to speak, or when you brain starts off thinking in that second language? My first language is English, and I am fairly fluent in French, but I speak much more coherently in French if my brain is thinking in French. If I think in English and then try to figure out how to say it in French, it's garbled, unclear, slow, etc. Not a pretty sight.
 
1 members found this post helpful.
Old 05-29-2022, 11:45 AM   #55
USUARIONUEVO
Senior Member
 
Registered: Apr 2015
Posts: 2,348

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Quote:
Originally Posted by 1483_fourteeneightythree View Post
People shouldn't be allowed to lie in Operating Systems forums or programming forums.
You start XD
 
1 members found this post helpful.
Old 05-29-2022, 11:52 AM   #56
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 796

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
Lets rewrite the os into assembler code! Oh wait, then we need to worry about which arch were building on, so lets make a program that reads a more generic language and builds arch specific code. Oh wait, we just invented a higher level language and a compiler again...

I'm surprised this thread has lived this long tbh
 
Old 05-29-2022, 11:58 AM   #57
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,593

Rep: Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459Reputation: 3459
Quote:
Originally Posted by 0XBF View Post
Lets rewrite the os into assembler code! Oh wait, then we need to worry about which arch were building on, so lets make a program that reads a more generic language and builds arch specific code. Oh wait, we just invented a higher level language and a compiler again...

I'm surprised this thread has lived this long tbh
Looks like we are a bunch of kind grownups who love to amuse this kid.

I wonder if his mommy knows that he posts crazy things in LQ...

Last edited by LuckyCyborg; 05-29-2022 at 03:04 PM.
 
1 members found this post helpful.
Old 05-30-2022, 05:13 AM   #58
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,987

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
OOPS! Wrong thread.

Last edited by chrisretusn; 05-30-2022 at 08:16 AM.
 
Old 06-03-2022, 02:38 PM   #59
1483_fourteeneightythree
LQ Newbie
 
Registered: May 2022
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dhalliwe View Post
Having worked in a few programming languages - and having had to read and debug programs in a few that I do not typically write in - my opinion is that translating a program into a new language is often not the best approach.

The original program will have been written (hopefully!) to optimize the code using the constructs available in that language. A different language may have additional or different constructs that either 1) work better, or 2) make it much clearer what the code is trying to do. If you want maintainable code, then clear code is better than obfuscated code translated from a different language.

Ancient example: trying to translate matrix manipulation from arrays in FORTRAN to pointers in C. Or working with ancient FORTRAN code that only has DO loops, and realizing that much of it would be far better off in a language with for-while, or repeat-until or for-each-X-in structures. Better off understanding the original purpose of the code and re-writing it efficiently in the new language.

And compilers or interpreters try to optimize what they are working with as source. I expect they do a better job at optimizing code that is well-written in that language, rather than some bastardized attempt to make that language work the way that some other language works.

Of course, modern programs make extensive use of existing libraries, modules, widgets, etc. that are often coded in a completely different language.

My impression as a newbie here is that many of the participants speak more than one (verbal, not computer) language. When speaking in your second (or third, or fourth) language, do you speak more efficiently when you think in your first language and translate into the one you want to speak, or when you brain starts off thinking in that second language? My first language is English, and I am fairly fluent in French, but I speak much more coherently in French if my brain is thinking in French. If I think in English and then try to figure out how to say it in French, it's garbled, unclear, slow, etc. Not a pretty sight.
Hello human,

Sometimes I translate stuff from english to spanish, sometimes from spanish to english, and sometimes I understand what something means in english but I don't know how to translate that to spanish preserving the full meaning of the words in english.

Thank you very much for your comments on source code translation ideas.

Have you checked the C++20 course that is available in freecodecamp?

Back in 2020 C++20 wasn't still fully implemented for use in Visual Studio Code.

I'll use CLion aniways, not Visual Studio Code.

Kind regards.


Quote:
Originally Posted by USUARIONUEVO View Post
You start XD
I'm not sure if I have lied... Everyone start asking questions (make another forum thread in an appropiate subforum) and I will give answers.
 
Old 06-09-2022, 10:32 AM   #60
half-word
LQ Newbie
 
Registered: Jan 2012
Location: Split, Croatia
Distribution: LinuxMint, Ubuntu, Debian, Devuan (+FreeBSD)
Posts: 24

Rep: Reputation: Disabled
Quote:
Originally Posted by 1483_fourteeneightythree View Post
People shouldn't be allowed to lie in Operating Systems forums or programming forums.
Huh, what are you talking about?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Translate NASM program into GNU Assembler one Sunless Programming 2 09-21-2020 07:13 AM
LXer: Crow Translate: Desktop / CLI Text Translation App Using Google Translate, Yandex Translate and Bing Translator LXer Syndicated Linux News 0 05-11-2019 05:13 AM
cryptography... what's difference between 8bits / 16 bits / 32 bits/ 64 bits/128bits? ybpark81 Linux - Security 4 02-19-2012 08:38 AM
BASH/No X: Using google translate to convert TXT files (translate) frenchn00b Programming 10 09-13-2009 10:55 PM
to translate or not to translate HTML rblampain General 2 07-05-2007 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration