Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Gentoo Chat
  • Search

Why not migrate Portage to C language?

Opinions, ideas and thoughts about Gentoo. Anything and everything about Gentoo except support questions.
Post Reply
  • Print view
Advanced search
162 posts
  • Page 3 of 7
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 7
  • Next

Would you like to see Portage rewritten in C?

Yes
78
45%
No
40
23%
Don't care
56
32%
 
Total votes: 174
Your vote has been cast.

Author
Message
alexander-n8hgeg5e
n00b
n00b
Posts: 58
Joined: Sat Nov 02, 2019 2:47 pm

  • Quote

Post by alexander-n8hgeg5e » Fri Dec 13, 2019 8:44 pm

ct85711 wrote:
Ionen wrote:That aside, I should probably just stop using portage for installing kernel sources. There's not really a point if my scripts end up doing the building anyway.
I made a kernel install ebuild today,
I had it as shell script befor, now i tried using an ebuild.

Probably not state of the art in ebuild programming,
but it works really well for me.
I did it because i wanted to do it automatic without compiling
with root privileges.
If someone want's to look at, it's here,

https://github.com/alexander-n8hgeg5e/m ... nux-gentoo
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Fri Dec 13, 2019 8:54 pm

IMHO some features may be lacking sucn as local MAKEOPTS configuration, maybe in /etc/portage/packages.env...
Thks 4 ur attention.
Top
alexander-n8hgeg5e
n00b
n00b
Posts: 58
Joined: Sat Nov 02, 2019 2:47 pm

  • Quote

Post by alexander-n8hgeg5e » Fri Dec 13, 2019 9:15 pm

Naib wrote:
That very interesting and makes sense.
I once looked at the code that nuitka generates,
and it looked very much like full feature blown python.
So one thing is, because of this features the programs
made by python will be good.
I love python.
It needs some few cpu cycles but they are a good investment.
For me it would not make sense to give up the
elegance of this language.
If i emerge something it's no problem
to use 50+ cpus fully loaded.
If portage gets running and the system is
fast enough the packages are flying.
Dependency calculation is the only thing
that feels slow if there are a lot of packages.
I don't really know how i'ts made
but i can imagine that this is the part
where having python comes in handy and makes
the complicated logic easier to implement.

In things of nuitka it's a really cool thing that
it can with almost no effort speed up python code
maybe x1.5.

I have to add:
To make things parallel is allways a good option,
you can find so many things that could
be offloaded to annother cpu in almost any program.
I even coded some "pyworkers" for my editor neovim.
They wait for tasks like communicate with tmux, check the daytime,...
Then i discoverd the python multiprocessing module
and it is really cool.
Last edited by alexander-n8hgeg5e on Fri Dec 13, 2019 10:48 pm, edited 2 times in total.
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Fri Dec 13, 2019 9:22 pm

Portage won't get significantly faster until libbash is finished.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Dec 13, 2019 10:06 pm

Ant P. wrote:Portage won't get significantly faster until libbash is finished.
That looks like never:
This page was last edited on 9 June 2018, at 13:03.
Top
xahodo
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 82
Joined: Thu May 17, 2007 12:36 pm
Location: Gouda, the Netherlands

  • Quote

Post by xahodo » Wed Dec 18, 2019 10:16 am

I'd like the dependency on python removed. Perhaps finally at that point python 2.7 gets removed from my system with the next update after that happens.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Wed Dec 18, 2019 10:48 am

xahodo wrote:I'd like the dependency on python removed. Perhaps finally at that point python 2.7 gets removed from my system with the next update after that happens.
not gonna happen in the short or medium term

Portage is written in python and bash. Feel free to rewrite in C but the onus is on you to show compliance to the PMS and then convince people to adopt it

There is a reason COBOL is still used... Inertia
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
alexander-n8hgeg5e
n00b
n00b
Posts: 58
Joined: Sat Nov 02, 2019 2:47 pm

  • Quote

Post by alexander-n8hgeg5e » Sun Jan 26, 2020 12:04 am

xahodo wrote:I'd like the dependency on python removed.
Do you want to remove python2 and 3 ?
To run only python3 it's possible i guess.
Top
crocket
Guru
Guru
Posts: 558
Joined: Sat Apr 29, 2017 2:12 pm

  • Quote

Post by crocket » Sat Feb 08, 2020 1:15 pm

If you want correctness and reliability and maintainability, haskell is a good choice.
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Feb 08, 2020 4:39 pm

The problem with Haskell is that it's a language built on lazy evaluation and nobody's actually called for it.
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Sat Feb 08, 2020 4:56 pm

So maintainable its proponents aren't willing to write or learn it!
Top
crocket
Guru
Guru
Posts: 558
Joined: Sat Apr 29, 2017 2:12 pm

  • Quote

Post by crocket » Sat Feb 08, 2020 9:52 pm

I learned haskell and wrote it. And, https://www.xkcd.com/1312/ is not about lazy evaluation. Lazy evaluation can actually be refreshing while it could lead to leak of space and time if you don't know what you are doing.

If you know how to control lazy evaluation, you can process infinite streams(e.g., radio stream) efficiently. You can also disable lazy evaluation in haskell.

To use any language efficiently requires some learning. Haskell is not a simple language, but it makes it easy to write correct programs. If a haskell program compiles, it probably works unless there are logic bugs.
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Feb 08, 2020 10:27 pm

crocket wrote:I learned haskell and wrote it.
In this context, by it, do you mean that you wrote some Haskell program as proof that you knew the language, or do you mean you wrote a Haskell port of some substantial portion of the package manager?
Top
crocket
Guru
Guru
Posts: 558
Joined: Sat Apr 29, 2017 2:12 pm

  • Quote

Post by crocket » Sat Feb 08, 2020 10:28 pm

I have written and maintained little haskell programs for my own usage.

The fact that I haven't written a package manager in haskell doesn't automatically mean haskell is unsuitable for package managers.

What I can say is that I could feel the benefits of haskell even in small programs. Ease of writing correct programs could be felt even at small scales.
Writing the same program in C or python felt like a drag because even python allows more classes of bugs than haskell does.
If you lose haskell's corectness, you want to at least gain nimbleness. Some lisp languages like janet attain nimbleness and some degrees of correctness. I personally use janet as a python killer.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Sat Feb 08, 2020 10:43 pm

Feel free to implement it. it is your responsibility to show compliance to PMS and then convince people to switch
Last edited by Naib on Sat Feb 08, 2020 11:33 pm, edited 1 time in total.
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
crocket
Guru
Guru
Posts: 558
Joined: Sat Apr 29, 2017 2:12 pm

  • Quote

Post by crocket » Sat Feb 08, 2020 10:51 pm

When I read RMS, I remember Richard Matthew Stallman, the founder of Free Software Foundation. Show compliance to richard stallman and GPL? Hail RMS.
By the way, I think RMS is out of shape. As a beginning body builder, I can't take him seriously. His body betrays lack of discipline.
His lack of discipline led him to microsoft.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Sat Feb 08, 2020 11:36 pm

I meant PMS. TLA aside... this isn't some edict, this is the specification on the package manager, just like there is a specification on the ebuild format. How a package manager behaves is bound by its spec so ebuild writers can be sure their ebuilds will be acted upon concisely.

you must show 100% traceability to the PMS because if you cannot then there is a possibility that an ebuild feature will be not acted upon as the ebuild developer is expected and other package managers do.

Once you have shown 100% traceability to the PMS then it is a matter of convincing people why your implementation is better than portage or pkgcore or paludis
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
crocket
Guru
Guru
Posts: 558
Joined: Sat Apr 29, 2017 2:12 pm

  • Quote

Post by crocket » Sun Feb 09, 2020 12:13 am

Is there any package manager that doesn't require perl-cleaner and haskell-updater?
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Sun Feb 09, 2020 12:39 am

crocket wrote: If a haskell program compiles, it probably works unless there are logic bugs.
If a C program compiles, it probably works, unless there are logic bugs. Same for Fortran. Is there a language that that is NOT true for?
Top
crocket
Guru
Guru
Posts: 558
Joined: Sat Apr 29, 2017 2:12 pm

  • Quote

Post by crocket » Sun Feb 09, 2020 1:11 am

With C, you have to worry about violating memory boundaries constantly even if a C program compiles.
A C program crashes if you are not careful about memory boundaries. Just writing a simple for loop in C can lead to buffer overflow.
People who work on computer security know how hard it is to write correct C programs that don't crash or lead to buffer overflow.
C requires a lot of discipline which is expensive. With haskell, you don't have to worry about it.
If you don't have the budget of NASA, maintaining a haskell program in a multi-person project is substantially cheaper and faster than maintaining a C program.

With python, you need to constantly worry about passing wrong types. Haskell prevents you from passing wrong types to functions.

Haskell is a good candidate for a package manager.
Last edited by crocket on Sun Feb 09, 2020 1:30 am, edited 2 times in total.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Sun Feb 09, 2020 1:27 am

crocket wrote:Is there any package manager that doesn't require perl-cleaner and haskell-updater?
Feel free to produce one, one that deals with the incompatibility of the target dev-lang. As I said the PMS is the canonical reference as to what the package manager must do when presented with an ebuild
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Sun Feb 09, 2020 1:29 am

crocket wrote: With python, you need to constantly worry about passing wrong types. Haskell prevents you from passing wrong types to functions.
incorrect

Code: Select all

def greet(name: str) -> str:
    return "Hello, " + name
the positional argument can only by of type:str and the return type can only be of type str. Type hinting has been in python since py35
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
crocket
Guru
Guru
Posts: 558
Joined: Sat Apr 29, 2017 2:12 pm

  • Quote

Post by crocket » Sun Feb 09, 2020 1:56 am

I'd rather use clojure than python for a dynamic language with optinoal typing.

By the way, regarding your political manifesto.
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
It's actually an argument against government. By relying on government, you sell your soul to the devil. The government is invested in keeping you dumb. It even poisons the water supply with neurotoxin called flouride. If a child ingested flouride regularly, the child's brain would not develop properly. The average IQ of people on earth has been declining for the last few decades. Flouride is best used in mouth wash, not drinking water. The best form of government is no government. The best form of no government is total self governance which takes a lot of discipline and training. No government, no lover, and no parent is going to do the work of obtaining individual sovereignty for you. You must do the work yourself. I intend to establish and maintain individual sovereignty.
Think about becoming jason bourne who obtained individual sovereignty through years of training and efforts.
Last edited by crocket on Sun Feb 09, 2020 2:21 am, edited 2 times in total.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Sun Feb 09, 2020 2:07 am

crocket wrote:With C, you have to worry about violating memory boundaries constantly even if a C program compiles.
A C program crashes if you are not careful about memory boundaries. Just writing a simple for loop in C can lead to buffer overflow.
People who work on computer security know how hard it is to write correct C programs that don't crash or lead to buffer overflow.
C requires a lot of discipline which is expensive. With haskell, you don't have to worry about it.
If you don't have the budget of NASA, maintaining a haskell program in a multi-person project is substantially cheaper and faster than maintaining a C program.
I've been writing C for about forty years, professionally for 25. I NEVER had those problems. Maybe code cowboys did, professionals didn't. You are spreading FUD.
Top
Dr.Willy
Guru
Guru
Posts: 547
Joined: Sun Jul 15, 2007 5:13 pm
Location: NRW, Germany

  • Quote

Post by Dr.Willy » Sun Feb 09, 2020 8:53 am

Tony0945 wrote:I've been writing C for about forty years, professionally for 25. I NEVER had those problems. Maybe code cowboys did, professionals didn't. You are spreading FUD.
oh dear… :roll:
gentoo repos: kakoune | oil | hyper-v
Top
Post Reply
  • Print view

162 posts
  • Page 3 of 7
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 7
  • Next

Return to “Gentoo Chat”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic