linux icon indicating copy to clipboard operation
linux copied to clipboard

this code very fast

Open ahmetilgin opened this issue 6 years ago • 233 comments

remove empty characters

ahmetilgin avatar Jul 17 '17 16:07 ahmetilgin

Hi @ahmetilgin!

Thanks for your contribution to the Linux kernel!

Linux kernel development happens on mailing lists, rather than on GitHub - this GitHub repository is a read-only mirror that isn't used for accepting contributions. So that your change can become part of Linux, please email it to us as a patch.

Sending patches isn't quite as simple as sending a pull request, but fortunately it is a well documented process.

Here's what to do:

  • Format your contribution according to kernel requirements
  • Decide who to send your contribution to
  • Set up your system to send your contribution as an email
  • Send your contribution and wait for feedback

How do I format my contribution?

The Linux kernel community is notoriously picky about how contributions are formatted and sent. Fortunately, they have documented their expectations.

Firstly, all contributions need to be formatted as patches. A patch is a plain text document showing the change you want to make to the code, and documenting why it is a good idea.

You can create patches with git format-patch.

Secondly, patches need 'commit messages', which is the human-friendly documentation explaining what the change is and why it's necessary.

Thirdly, changes have some technical requirements. There is a Linux kernel coding style, and there are licensing requirements you need to comply with.

Both of these are documented in the Submitting Patches documentation that is part of the kernel.

Note that you will almost certainly have to modify your existing git commits to satisfy these requirements. Don't worry: there are many guides on the internet for doing this.

Who do I send my contribution to?

The Linux kernel is composed of a number of subsystems. These subsystems are maintained by different people, and have different mailing lists where they discuss proposed changes.

If you don't already know what subsystem your change belongs to, the get_maintainer.pl script in the kernel source can help you.

get_maintainer.pl will take the patch or patches you created in the previous step, and tell you who is responsible for them, and what mailing lists are used. You can also take a look at the MAINTAINERS file by hand.

Make sure that your list of recipients includes a mailing list. If you can't find a more specific mailing list, then LKML - the Linux Kernel Mailing List - is the place to send your patches.

It's not usually necessary to subscribe to the mailing list before you send the patches, but if you're interested in kernel development, subscribing to a subsystem mailing list is a good idea. (At this point, you probably don't need to subscribe to LKML - it is a very high traffic list with about a thousand messages per day, which is often not useful for beginners.)

How do I send my contribution?

Use git send-email, which will ensure that your patches are formatted in the standard manner. In order to use git send-email, you'll need to configure git to use your SMTP email server.

For more information about using git send-email, look at the Git documentation or type git help send-email. There are a number of useful guides and tutorials about git send-email that can be found on the internet.

How do I get help if I'm stuck?

Firstly, don't get discouraged! There are an enormous number of resources on the internet, and many kernel developers who would like to see you succeed.

Many issues - especially about how to use certain tools - can be resolved by using your favourite internet search engine.

If you can't find an answer, there are a few places you can turn:

  • Kernel Newbies - this website contains a lot of useful resources for new kernel developers.
  • If you'd like a step-by-step, challenge-based introduction to kernel development, the Eudyptula Challenge would be an excellent start.
  • The kernel documentation - see also the Documentation directory in the kernel tree.

If you get really, really stuck, you could try the owners of this bot, @daxtens and @ajdlinux. Please be aware that we do have full-time jobs, so we are almost certainly the slowest way to get answers!

I sent my patch - now what?

You wait.

You can check that your email has been received by checking the mailing list archives for the mailing list you sent your patch to. Messages may not be received instantly, so be patient. Kernel developers are generally very busy people, so it may take a few weeks before your patch is looked at.

Then, you keep waiting. Three things may happen:

  • You might get a response to your email. Often these will be comments, which may require you to make changes to your patch, or explain why your way is the best way. You should respond to these comments, and you may need to submit another revision of your patch to address the issues raised.
  • Your patch might be merged into the subsystem tree. Code that becomes part of Linux isn't merged into the main repository straight away - it first goes into the subsystem tree, which is managed by the subsystem maintainer. It is then batched up with a number of other changes sent to Linus for inclusion. (This process is described in some detail in the kernel development process guide).
  • Your patch might be ignored completely. This happens sometimes - don't take it personally. Here's what to do:
    • Wait a bit more - patches often take several weeks to get a response; more if they were sent at a busy time.
    • Kernel developers often silently ignore patches that break the rules. Check for obvious violations of the the Submitting Patches guidelines, the style guidelines, and any other documentation you can find about your subsystem. Check that you're sending your patch to the right place.
    • Try again later. When you resend it, don't add angry commentary, as that will get your patch ignored. It might also get you silently blacklisted.

Further information

Happy hacking!

This message was posted by a bot - if you have any questions or suggestions, please talk to my owners, @ajdlinux and @daxtens, or raise an issue at https://github.com/ajdlinux/KernelPRBot.

KernelPRBot avatar Jul 17 '17 16:07 KernelPRBot

Also, hope you are kidding with this one.. 😅

LauraRozier avatar Jul 18 '17 13:07 LauraRozier

i think this should get merged in

kylelamse avatar Jul 19 '17 16:07 kylelamse

@ItzLevvie Don't you think it's easier to read? It's now only one line of code!

kylelamse avatar Jul 19 '17 20:07 kylelamse

@ahmetilgin The kernel is written in C. C isn't an interpreted language like JS. Instead, it is compiled. Empty characters and spaces don't affect execution speed.

That being said: It looks much more readable than the current code.

benajaero avatar Jul 22 '17 11:07 benajaero

Yes is dank agree

rxdn avatar Jul 22 '17 20:07 rxdn

@Blaze349 The Linux kernel takes soooooo long to compile. This will increase compilation speed by removing all the unnecessary whitespace the compiler has to skip over.

jeandrek avatar Jul 23 '17 04:07 jeandrek

@kylelamse Are you joking? Minifying a code doesn't make it 'readable'... In Javascript it's used to reduce bandwidth between server & the user, reduce page execution time & reduce file size

@ahmetilgin don't bother wasting your time on the PR. This won't improve anything except for decreasing file size. Also, there are a lot of comments in the 'minified code' that you've not bothered to remove. But again don't bother about it.

@Jonathan50 If a Linux kernel takes 'soo long to compile' then you need to invest in a better CPU like Xeon. Compiling Android or a kernel requires you to have more cores to speed up the compiling process. If you have less cores then it will take more time to compile.

No one loves the code unless it's a sarcasm

@ItzLevvie I do have to agree, this won't get accepted anyways because of contributing guidelines. So you don't have to worry about it.

@dadur604 no he doesn't need any help.. he's just trying to make the community laugh by committing garbage code.

@Blaze349 C is already fast enough... there's no need to do all the stuff the compiler will do it for you automatically or you can add some flags to optimise it.

@thibmo I believe he's trying to make the community laugh. If it's serious then I would obliviously laugh even more.

ghost avatar Jul 23 '17 12:07 ghost

@7bf70ec5 Linus Torvalds uses a Macbook Air so...yeah. Also, the kernel isn't written in C# 🤣 . It's written in C and a little Assembly.

benajaero avatar Jul 23 '17 12:07 benajaero

@DizAzTor Should be easier. You no longer have to scroll through thousands of lines of code. Having it on one line just makes sense.

kylelamse avatar Jul 24 '17 19:07 kylelamse

Wow, now that's some beautiful code aesthetics. Congrats

jpitchardu avatar Jul 24 '17 19:07 jpitchardu

@DizAzTor why maintain when you can not maintain

rxdn avatar Jul 24 '17 19:07 rxdn

Are you seriously kidding me?😂

iamsubhranil avatar Jul 25 '17 00:07 iamsubhranil

yes this is beautiful 10/10

ghost avatar Jul 25 '17 15:07 ghost

No one loves the code unless it's a sarcasm

@7bf70ec5

kylelamse avatar Jul 25 '17 22:07 kylelamse

I've never laughed at code so hard in my life. Thanks for that! Definitely a much needed contribution. Linus has nothing on this guy.

Perhaps this should go into a new Linux for Comedy branch.

dschwartz783 avatar Jul 26 '17 01:07 dschwartz783

Thats just, thats's hmm what is it?..... It's ART :D Put it in a Museum.

PeterAlfonsLoch avatar Jul 26 '17 03:07 PeterAlfonsLoch

10/10 best commit ever made (other than adding rm -rf / to ~/.bashrc)

iamunknown2 avatar Jul 26 '17 06:07 iamunknown2

This made me laugh so hard. I want Linus's reaction on this now.

hanss314 avatar Jul 27 '17 00:07 hanss314

Linus will say "f**k you" like when he told Nvidia ✌️

vuanhson avatar Jul 27 '17 08:07 vuanhson

Good job!

numbqq avatar Jul 28 '17 06:07 numbqq

🍌

m0x23 avatar Jul 30 '17 14:07 m0x23

Are you sure this can be compiled? Maybe this is a joke.

lgyjg avatar Aug 02 '17 08:08 lgyjg

There are still too many lines of code. We should remove the comment at the top of the file. It will help the code compile even faster and we'll have less lines to scroll through.

nhooyr avatar Aug 03 '17 15:08 nhooyr

code is ## sonic fast :)) 👍 💯

SharpOB avatar Aug 03 '17 17:08 SharpOB

This should be a GCC pull request. GCC must support partial prefix match of keywords for fast processing of C code. For eg: GCC should match the tokens #inc as #include et al. This will further reduce the compilation time and C file size

vijunag avatar Aug 04 '17 02:08 vijunag

You can make it even faster by commenting out the last line.

It slightly alters the behavior, but it'll run almost instantly.

TheBITLINK avatar Aug 04 '17 16:08 TheBITLINK

@ahmetilgin You can make your country develop faster by removing yourself.

ooploopl- avatar Aug 05 '17 14:08 ooploopl-

10/10 would compile 🚫

Salakar avatar Aug 05 '17 14:08 Salakar

Blown away, BLAZING FAST!

On Sat, Aug 5, 2017 at 7:59 PM, Michael Diarmid [email protected] wrote:

10/10 would compile.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/torvalds/linux/pull/437#issuecomment-320446685, or mute the thread https://github.com/notifications/unsubscribe-auth/ANkje0ACmOQfz5R6d5bFgspdSoZXt763ks5sVHxWgaJpZM4OaL_8 .

windlessStorm avatar Aug 05 '17 14:08 windlessStorm

You can improve the speed of the preprocessor by removing the includes.

benajaero avatar Aug 06 '17 00:08 benajaero

top kek

joshuarli avatar Aug 07 '17 22:08 joshuarli

Aside from the sarcasm and everything - has anyone actually compiled and tested this?

tilda avatar Aug 08 '17 02:08 tilda

@tilda My guess: fail I mean, I hope you can see that this would never work..

staticintkernel_init(void*);

LauraRozier avatar Aug 08 '17 07:08 LauraRozier

@thibmo RIP

tilda avatar Aug 08 '17 08:08 tilda

@thibmo I'm amazed that you seriously think that we think it would work.

dschwartz783 avatar Aug 08 '17 22:08 dschwartz783

@dschwartz783 As I am amazed that you think that I think that you think it would work. 😛

LauraRozier avatar Aug 09 '17 07:08 LauraRozier

why isn't this merged in yet

sdfgsdfgd avatar Aug 09 '17 08:08 sdfgsdfgd

this is urgent for linux success pls merge soon @linus

alexozer avatar Aug 09 '17 21:08 alexozer

Looks very fast to me

Wiciaki avatar Aug 10 '17 15:08 Wiciaki

the best code I've ever seen in my life

nicholasyau avatar Aug 11 '17 07:08 nicholasyau

This code was so good it made me laugh and then cry of joy

On Aug 11, 2017 3:08 AM, "Nicholas Yau" [email protected] wrote:

the best code I've ever seen in my life

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/torvalds/linux/pull/437#issuecomment-321744584, or mute the thread https://github.com/notifications/unsubscribe-auth/AETfrlKR1-hYDq0fX_1SNS7RN4rcSLgjks5sW_3TgaJpZM4OaL_8 .

ghost avatar Aug 11 '17 12:08 ghost

10/10 -IGN

dragonGR avatar Aug 11 '17 22:08 dragonGR

@torvalds

kylelamse avatar Aug 11 '17 23:08 kylelamse

I rest assured at the review board's unanimous approval

alexozer avatar Aug 12 '17 00:08 alexozer

wut da f*** this is just IT'S NOT CODE GOLF HERE GUYS

GolfingSuccess avatar Aug 31 '17 16:08 GolfingSuccess

yes @GolfingSuccess its code very fast

cannap avatar Aug 31 '17 16:08 cannap

maybe one day I will be as brilliant as @ahmetilgin, ive tried to contribute #447 in the same light

alexozer avatar Aug 31 '17 17:08 alexozer

@cannap its code very really fast

GolfingSuccess avatar Sep 01 '17 08:09 GolfingSuccess

@Blaze349 There is no such thing as compiled and interpreted languages. Any language can be both compiled and interpreted. Moreover there is nothing in the C standard that talks against being able to use an interpreter instead.

Mikotochan avatar Sep 01 '17 10:09 Mikotochan

But for science, just how much faster compilation would be if the whole kernel would be seriously minified ? Would minifying + compiling take less time than just compiling ?

startas avatar Sep 01 '17 12:09 startas

@Mikotochan In fact there are C interpreters.

GolfingSuccess avatar Sep 01 '17 12:09 GolfingSuccess

@startas I don't think minification takes too long...

GolfingSuccess avatar Sep 01 '17 12:09 GolfingSuccess

Wow! Now it's much scalable! Thanks

wongmjane avatar Sep 01 '17 21:09 wongmjane

🤔

etjossem avatar Sep 01 '17 22:09 etjossem

My mind refuses to believe that this actually happened. Fucking hilarious.

mariorodriguespt avatar Sep 01 '17 22:09 mariorodriguespt

@ahmetilgin

With Javascript the code is sent to the browser, which then compiles it and executes it on the client machine. Minifying Javascript makes it smaller, meaning that it downloads faster. In addition, part of compiling is parsing - this is where the compiler "understands" the code and having fewer characters (such as whitespace) will make a small improvement in parsing time.

Once code has been compiled, the original size of the source code is irrelevant (except with certain circumstances with Javascript).

C++ (the language that the Linux kernel is written in) doesn't work like Javascript at all. You take the code and compile it on your machine and then copy the compiled result to other machines in order to execute it.

Whitespace in C++ has no effect on performance, because that whitespace is never copied to the machines that are running the C++ program.

The most important thing about making performance enhancements is taking measurements to see if your enhancement has worked. This is called benchmarking. If you had benchmarked your changes, you would have seen that this had no effect on performance.

Don't be discouraged and keep learning.

jcdickinson avatar Sep 01 '17 22:09 jcdickinson

✍️ Signing off on this

revmischa avatar Sep 01 '17 22:09 revmischa

Just tried it and I agree that this code in fact very fast

AndrewBelt avatar Sep 01 '17 23:09 AndrewBelt

http://i.memecaptain.com/gend_images/N_8znQ.gif

austinheap avatar Sep 01 '17 23:09 austinheap

dank

pablomdo avatar Sep 01 '17 23:09 pablomdo

just delete the last line, will be the fastest code ever

OpenCoderX avatar Sep 01 '17 23:09 OpenCoderX

this guy should be the successor of @torvalds

miguel550 avatar Sep 01 '17 23:09 miguel550

bhalash avatar Sep 01 '17 23:09 bhalash

hi there, I really don't get it? could someone explain? does this infact speed up things? or a gimmic? thanks for your time! :) Majid

On 01/09/2017, Mark [email protected] wrote:

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/torvalds/linux/pull/437#issuecomment-326705606

-- kind regards, Majid Hussain

mhussaincov avatar Sep 01 '17 23:09 mhussaincov

I think this pull request isn't finished yet. There are still so many files to minify. Please continue your hard work to make this world better and Linux code faster. Cheers!

sxua avatar Sep 01 '17 23:09 sxua

I keep getting compiler errors. Someone help: $ ruby main.c > linux.exe

nmani avatar Sep 01 '17 23:09 nmani

It is faster when doing code reviews in the future as well, as users who view the file in the browser have a faster loading time due to the reduction of whitespace. Users who check out this file will find faster download and file opening times as well in addition to the faster compiling time!

lawonga avatar Sep 01 '17 23:09 lawonga

Ship it!

andrewshatnyy avatar Sep 01 '17 23:09 andrewshatnyy

sorryyoudon'tunderstand.Hi@ahmetilgin!ThanksforyourcontributiontotheLinuxkernel!Linuxkerneldevelopmenthappensonmailinglists,ratherthanonGitHub-thisGitHubrepositoryisaread-onlymirrorthatisn'tusedforacceptingcontributions.SothatyourchangecanbecomepartofLinux,pleaseemailittousasapatch.Sendingpatchesisn'tquiteassimpleassendingapullrequest,butfortunatelyitisawelldocumentedprocess.Here'swhattodo:FormatyourcontributionaccordingtokernelrequirementsDecidewhotosendyourcontributiontoSetupyoursystemtosendyourcontributionasanemailSendyourcontributionandwaitforfeedbackHowdoIformatmycontribution?TheLinuxkernelcommunityisnotoriouslypickyabouthowcontributionsareformattedandsent.Fortunately,theyhavedocumentedtheirexpectations.Firstly,allcontributionsneedtobeformattedaspatches.Apatchisaplaintextdocumentshowingthechangeyouwanttomaketothecode,anddocumentingwhyitisagoodidea.Youcancreatepatcheswithgitformat-patch.Secondly,patchesneed'commitmessages',whichisthehuman-friendlydocumentationexplainingwhatthechangeisandwhyit'snecessary.Thirdly,changeshavesometechnicalrequirements.ThereisaLinuxkernelcodingstyle,andtherearelicensingrequirementsyouneedtocomplywith.BothofthesearedocumentedintheSubmittingPatchesdocumentationthatispartofthekernel.Notethatyouwillalmostcertainlyhavetomodifyyourexistinggitcommitstosatisfytheserequirements.Don'tworry:therearemanyguidesontheinternetfordoingthis.WhodoIsendmycontributionto?TheLinuxkerneliscomposedofanumberofsubsystems.Thesesubsystemsaremaintainedbydifferentpeople,andhavedifferentmailinglistswheretheydiscussproposedchanges.Ifyoudon'talreadyknowwhatsubsystemyourchangebelongsto,theget_maintainer.plscriptinthekernelsourcecanhelpyou.get_maintainer.plwilltakethepatchorpatchesyoucreatedinthepreviousstep,andtellyouwhoisresponsibleforthem,andwhatmailinglistsareused.YoucanalsotakealookattheMAINTAINERSfilebyhand.Makesurethatyourlistofrecipientsincludesamailinglist.Ifyoucan'tfindamorespecificmailinglist,thenLKML-theLinuxKernelMailingList-istheplacetosendyourpatches.It'snotusuallynecessarytosubscribetothemailinglistbeforeyousendthepatches,butifyou'reinterestedinkerneldevelopment,subscribingtoasubsystemmailinglistisagoodidea.(Atthispoint,youprobablydon'tneedtosubscribetoLKML-itisaveryhightrafficlistwithaboutathousandmessagesperday,whichisoftennotusefulforbeginners.)HowdoIsendmycontribution?Usegitsend-email,whichwillensurethatyourpatchesareformattedinthestandardmanner.Inordertousegitsend-email,you'llneedtoconfiguregittouseyourSMTPemailserver.Formoreinformationaboutusinggitsend-email,lookattheGitdocumentationortypegithelpsend-email.Thereareanumberofusefulguidesandtutorialsaboutgitsend-emailthatcanbefoundontheinternet.HowdoIgethelpifI'mstuck?Firstly,don'tgetdiscouraged!Thereareanenormousnumberofresourcesontheinternet,andmanykerneldeveloperswhowouldliketoseeyousucceed.Manyissues-especiallyabouthowtousecertaintools-canberesolvedbyusingyourfavouriteinternetsearchengine.Ifyoucan'tfindananswer,thereareafewplacesyoucanturn:KernelNewbies-thiswebsitecontainsalotofusefulresourcesfornewkerneldevelopers.Ifyou'dlikeastep-by-step,challenge-basedintroductiontokerneldevelopment,theEudyptulaChallengewouldbeanexcellentstart.Thekerneldocumentation-seealsotheDocumentationdirectoryinthekerneltree.Ifyougetreally,reallystuck,youcouldtrytheownersofthisbot,@[email protected],sowearealmostcertainlytheslowestwaytogetanswers!Isentmypatch-nowwhat?Youwait.Youcancheckthatyouremailhasbeenreceivedbycheckingthemailinglistarchivesforthemailinglistyousentyourpatchto.Messagesmaynotbereceivedinstantly,sobepatient.Kerneldevelopersaregenerallyverybusypeople,soitmaytakeafewweeksbeforeyourpatchislookedat.Then,youkeepwaiting.Threethingsmayhappen:Youmightgetaresponsetoyouremail.Oftenthesewillbecomments,whichmayrequireyoutomakechangestoyourpatch,orexplainwhyyourwayisthebestway.Youshouldrespondtothesecomments,andyoumayneedtosubmitanotherrevisionofyourpatchtoaddresstheissuesraised.Yourpatchmightbemergedintothesubsystemtree.CodethatbecomespartofLinuxisn'tmergedintothemainrepositorystraightaway-itfirstgoesintothesubsystemtree,whichismanagedbythesubsystemmaintainer.ItisthenbatchedupwithanumberofotherchangessenttoLinusforinclusion.(Thisprocessisdescribedinsomedetailinthekerneldevelopmentprocessguide).Yourpatchmightbeignoredcompletely.Thishappenssometimes-don'ttakeitpersonally.Here'swhattodo:Waitabitmore-patchesoftentakeseveralweekstogetaresponse;moreiftheyweresentatabusytime.Kerneldevelopersoftensilentlyignorepatchesthatbreaktherules.CheckforobviousviolationsofthetheSubmittingPatchesguidelines,thestyleguidelines,andanyotherdocumentationyoucanfindaboutyoursubsystem.Checkthatyou'resendingyourpatchtotherightplace.Tryagainlater.Whenyouresendit,don'taddangrycommentary,asthatwillgetyourpatchignored.Itmightalsogetyousilentlyblacklisted.FurtherinformationWorkingwiththekerneldevelopmentcommunity-theofficialdocumentationfornewkernelcontributorsHappyhacking!Thismessagewaspostedbyabot-ifyouhaveanyquestionsorsuggestions,pleasetalktomyowners,@ajdlinuxand@daxtens,orraiseanissueathttps://github.com/ajdlinux/KernelPRBot.

rafaelreinert avatar Sep 02 '17 00:09 rafaelreinert

@nmani

I keep getting compiler errors. Someone help: $ ruby main.c > linux.exe

Did you install the dependencies with npm?

jeandrek avatar Sep 02 '17 00:09 jeandrek

Why stop at init/main.c? Do all the sources!

spacekookie avatar Sep 02 '17 00:09 spacekookie

LGTM

sgunadhya avatar Sep 02 '17 00:09 sgunadhya

Still looks better then git!

Coder31415926 avatar Sep 02 '17 02:09 Coder31415926

Sorrytointerruptthisfineconversation.Perhapstheresmoretothisnowhitespacenotation.verykawaii

ghost avatar Sep 02 '17 05:09 ghost

In all seriousness, let's quit joking around.

We can't merge this on GitHub, need to make a real kernel patch and get it approved on the mailing lists.

alexozer avatar Sep 02 '17 06:09 alexozer

An awesome one-liner!

f avatar Sep 02 '17 09:09 f

I mean come on guys the submitter is definitely retard. Who could read the code look like a js compiled. He should read at least basics of the K&R book or read anything about C and C++ comments and empty lines as everywhere are ignored. There is no point spamming my inbox although the tread was a fun joke on a pull request submitter its annoying now. I woke up and go over 60 messages from github torvalds 437 I mean wtf guys. Stop it. :) I'm going to mute whole torvalds repo if you keep doing this on other threads. Things to do advice to all of you:

  1. Do some contribution to Open Source or FSF project.
  2. have fun outside of joking and trolling people.
  3. Have a life.

MarkoShiva avatar Sep 02 '17 09:09 MarkoShiva

@jcdickinson Oh man I thought that someone who would write an explanation would at least know the difference between C and C++ code when you see it and plus the design of the programming language difference.

Sorry man you fail bad Kernel is written in C which is bad because C and every decedent of it suffers from memory surface attacks like buffer overflows, stack crashing dangling pointers just try to allocate memory outside of your stack and you get a segfault. :)

Plus the monolithic is much worse then good implemented microkernel so well we need to write or rewrite a new kernel in some functional programming paradigm language whether that is Ocaml or Rust would like to hear opinion of others on this.

And btw it is easy to write a fully functioning small kernel but to make it compatible with a lot of hardware that is a hard thing and addition of many lines in case of the Linux kernel because all of the drivers and handling of the devices in case of monolithic kernel is done inside of the kernel.

So when you see 2 million new lines in the kernel even without checking the release notes you should know that over a 90 percent of that is for device drivers and some others are for support of whether filesystems or improving in handling of some hardware and very small amount is actually focused on what the kernel is and that is memory, disk IO, CPU handling and communication in between them improvement. So anyway I just wanted to add to this ranting thread something that have more technical description :P

@mhussaincov No in C C++ and almost language built on top of them and other languages like Java like python you name it the comment lines and blank lines or ignored at the compile and or there just to improve the readability of the code.

So what you should learn is to use certain way of writing code consistently which mean if you are doing opening curly brace on the same line as the function do it like that through whole project, if you are using gnu 2 space indentation do it like that all the way etc.

And always add blank lines between functions and block comments before the important or any function that explain what it does and also for a clarification add single line comments on places where you think that you would like to clarify what the step does. And do that consistently because if you don't you might not be able to understand your code or the why you wrote it certain way a 6 months from now.

There are a lot of books on writing a source code on the proper way I mean books like How to write a good source code, and if you don't like reading books then you could read PEP8 from python which speak about similar things that are not required but recommended as a good practice to improve readability of your source code.

MarkoShiva avatar Sep 02 '17 10:09 MarkoShiva

@jcdickinson Btw one clarification more the main difference between C and C++ is the different programming paradigm they suggest although both being general level programming languages C++ introduces the OOP concept upon C.

So the C++ is superset of you can write C code in C++ and use any of the functions and libraries of the same but you can also use C++ style and write in OOP paradigm.

Although I'm not saying that C++ have the best OOP implementation nor even that OOP is necessary anymore Bjarne in his write ups about why he made a C++ always say that he made it for his own use and later people adopted.

The main point of this is to say that C++ although being an easy language like C it actually make too many ways to do the same thing which lead to a lot of bad programming style, or bad class design and implementation. Multiple inheritance is nice and fun when you know C++ well but its really a problem if you don't know it well you make a very bad OOP design in that case Java is better and simpler for beginners as it allows only single inheritance.

The other problem of C++ the power that use of pointers in language have because dangling pointers wrong dereferencing not deleting your memory allocation once it is out of scope, which is also problem of C can lead to lot of bugs.

And actually most of the C and C++ bugs beside the bad logical implementation which would be a fault of a person who write the code is the problem with not dealocated memory or pointers that point to a wrong part of memory and make programs crashes. In other words buffer overflows and stack smashing which all lead to segfaulting or even worse if they are not properly handled by the operating system like in case of Micro$hit windblows.

MarkoShiva avatar Sep 02 '17 10:09 MarkoShiva

it could be faster :)

eemirtekin avatar Sep 02 '17 10:09 eemirtekin

Wow!

BrkSe avatar Sep 02 '17 10:09 BrkSe

@eemirtekin in the name of raki i hope you're joking.

dragonGR avatar Sep 02 '17 10:09 dragonGR

@ahmetilgin do you have a cigarette?

abdvel avatar Sep 02 '17 11:09 abdvel

@dragonGR absolutely :D

eemirtekin avatar Sep 02 '17 11:09 eemirtekin

:shipit:

dougmcmillan avatar Sep 02 '17 11:09 dougmcmillan

Kindly excuse my impertinence by https://github.com/torvalds/linux/pull/447

ghost avatar Sep 02 '17 12:09 ghost

This should be combined and squashed with PR #175 to reduce memory utilization

revmischa avatar Sep 02 '17 12:09 revmischa

Nice trolling commit. xD

dimixar avatar Sep 02 '17 12:09 dimixar

@dimixar why trolling this code very very fast :p

GolfingSuccess avatar Sep 02 '17 13:09 GolfingSuccess

I have no life. Please merge this.

alexozer avatar Sep 02 '17 14:09 alexozer

Yes, please merge!!!

lodnert avatar Sep 02 '17 18:09 lodnert

1

alexozer avatar Sep 02 '17 18:09 alexozer

2

alexozer avatar Sep 02 '17 18:09 alexozer

3

alexozer avatar Sep 02 '17 18:09 alexozer

4

alexozer avatar Sep 02 '17 18:09 alexozer

+1 get

greenboxal avatar Sep 02 '17 20:09 greenboxal

5

alexozer avatar Sep 02 '17 21:09 alexozer

The best Greek coder @ahmetilgin Thanks for made the biggest contribution to linux!

emr avatar Sep 02 '17 23:09 emr

6 r/counting

alexozer avatar Sep 03 '17 00:09 alexozer