1.  

    Honestly, I never quite managed it. I was using windows 10, where I was able to use WSL and have quite a lot of my familiar tools, but it was never quite the same. I recommend experimenting with msys2, mingw, cygwin, and git bash and seeing which one gives you the toolset you need. Install a terminal of some kind because the one that comes with windows sucks. You can try conemu (or cmder, which bundles it); or you can run a unix terminal through x11. I haven’t tried it, but afaik if you install vcxsrv you can run xterm, konsole, gnome-terminal, etc. through cygwin. Latter will give you a better terminal experience, but more overhead and possibly more input lag.

    Regarding vim–see if you can get permission to install chocolatey. They have an enterprise package, which will appeal to the sorts of people who want to restrict what you can install, and they have a tonne of software you will find useful, including vim (among other things). Also, see if you can get permission to install powershell core. There is a powershell.exe, which comes with the system and is infinitely better than cmd.exe, to the point where I recommend never using the latter if you can help it, but powershell is getting old and powershell core is an updated version (launch with pwsh.exe) that’s a bit nicer. It’s officially made by microsoft; so again, shouldn’t be too hard to convince them to let you install it.

    Good luck!

    1. 5

      I don’t understand.

      Even if you do want to see a mobile view, firefox and I believe chrome developer tools already allow you to do that.

      1. 2

        When it comes to debugging mobile views, I’d like to be able to set the results of media queries by hand. For example, I made a pure CSS mobile/desktop switch on my website based on “pointer: [fine|coarse]”, but I could only test it on an actual phone because I coudn’t find a way to make desktop FF or Chrome pretend they have a coarse pointing device.

        If I’m missing something, point me in the right direction.

        1. 2

          packaging these things by default is considered newsworthy in the apple ecosystem

          1. 1

            As does Safari, of course.

          1. 2

            I keep hearing of people switching to windows and finding the experience nice–or, at least, tolerable.

            I just don’t get it.

            I had to use windows for a few months recently, and I made do, as best I could. Used WSL, an X server, git for windows, the works; but it was still an awful, slow, buggy, poorly-designed mess.

            1. 14

              There are two reasons that I don’t like tabs:

              1. “Tabs for indent, spaces for alignment” requires a lot of discipline. Even if you’re disciplined, it’s easy to screw up and the mistake isn’t noticeable until you change your tab width display preference. In my experience working on teams, I have found that it’s hard enough to get people to use tabs or spaces without screwing that up. To ask them to use a specific mixture of tabs and spaces is an unwinnable battle.
              2. It’s hard to enforce meaningful rules about line length when you use tabs for indentation. When you use spaces, you can have a simple rule “lines shall not exceed 100 characters except in the case of user visible strings on their own line”. When you use tabs for indentation, you have to change your rule to “lines shall not exceed 100 characters wide based on a tab rendering width of 8 spaces except in the case of user visible strings on their own line”. Many people will choose a tab rendering width narrower than 8 spaces and as a result it will be very easy for them to author lines which are under 100 characters in their environment, but span past 100 when tabs are expanded to 8 space width.
              1. 4

                Maybe the first point can be mitigated by having a highlighting rule that paints ^\s*( \t|\t ).* bright red. Or by prettier! Code auto formatters are lovely. ❤

                1. 1

                  Sometimes, though, you can use only tabs for alignment, to get it to align just right; that won’t help you there.

                2. 3
                  1. Use visible whitespace in your editor and it is easier to be disciplined about. Combined with a .editorconfig file and IDE tools to detect mistakes, and it is not as hard as all that.
                  2. I’ve never found line length restrictions to be valuable, so this is not a consideration for me. In a world with word-wrap, where many people working in tech have 27” monitors, and in which a horizontal scrollbar exists, it just seems unimportant. Code in practice in my experience tends to fall within reasonable limitations naturally, anyway. The only times I’ve rejected a code review because a line of code was too long was because the engineer was trying to do too many things on one line anyway (ie, ternary operator magic, or math that could be abstracted into local vars for readability). Character restrictions for line length seem overly pedantic to me unless you have a specific technical reason to have them (ie, this has to display on an old TTY or has to be printed out at a specific font size or something). Why would you need them in the general case?
                  1. 5

                    Word wrap is garbage, especially for diffs / 3 way merges. On my 27” 2560x1440 display at a normal font size, 80 chars wide fits 3 side by side panes of code. Or the diff view in my IDE (2 panes), with space for the sidebar and gutters. Or just cross-referencing 2 files.

                    Working on code with a hard 80 chars rule has been magnificent.

                    1. 4

                      Why would you need them in the general case?

                      I like to split my window to 2 or 3 columns, so even though I have a wide screen monitor, I value 80-column source code restrictions. This allows me to simply have 2 or 3 files open at the same time which I can browse independently.

                      Example: https://i.imgur.com/Xvj9R.png (not my screenshot, but it looks pretty similar in my setup)

                    2. 3

                      While I understand the reasoning here. These are preferences and IMO accessibility > preferences.

                      1. 13

                        IMO accessibility > preferences.

                        Well. This is being presented as some sort of binary absolute – that is, “spaces = 0% accessible, tabs = 100% accessible” – with no mention of compromises or tradeoffs or deeper investigation. But actual accessibility never works that way. There’s always a spectrum of options, each coming with its own set of tradeoffs, and navigating them well requires context and understanding and weighing those tradeoffs against each other.

                        So color me skeptical of the rush by many people to declare victory in the tabs-versus-spaces holy war on the grounds that “it’s proven more accessible to use tabs, so tabs win”. Those people didn’t realize until very recently that there even could be accessibility implications to the choice. I wonder what thing they don’t realize today they’ll get to find out about tomorrow.

                        1. 1

                          Fair point, I have been an avid spaces advocate mostly for the sake of consistency. I have never really cared much about alignment and prefer to align things at the beginnings of lines. But what this pointed out to me was that while my arguments for spaces have mostly been preferences about code structure, the other side has a real legitimate need that surpasses my preference. Perhaps there is another accessibility case that supports spaces, I just haven’t heard it in the 20 years I have been having these discussions. But to be fair, I hadn’t heard this one until today, while I have worked with deaf programmers, I have yet to work with anyone visually impaired.

                          1. 2

                            The first issue that comes to mind for me, with this specific situation, is that it’s almost certain to come down to tooling. Accessibility tools tend to kind of suck, but that creates a situation where you need to be very careful to maximize someone’s ability to use accessibility tools while not building permanent assumptions in about the abilities and shortcomings of the specific tools available right now. If we all rush out and convert to tabs-only today without any further thought about it, we run the risk of locking in the shortcomings of today’s tools in ways that may not be good tomorrow.

                            Which is why I’d really prefer to hear educated opinions from people with expertise in accessibility tooling and practices before coming to any decisions based on this.

                    1. 10

                      My reactions are:

                      • Are the spaces people just now figuring this out? If that is the case, get out of your bubble and into the real world where you can encounter, for example, blind people, whom perceive the digital world through a Braille-display of usually only 1x40 character displays or 2x80 character displays if they are lucky. Taking up 3 tab symbols is way better than taking up 12 or 24 symbols on their displays. Tabs are simply a blessing for accessibility in most cases.
                      • Ever looked at a hex/deximal-dump of your source files? I definitely prefer code written with tabs in that case. You just look for the 09 bytes and count them to figure out your level of indentation. Counting to 3 0x09 or 09 bytes is better than counting 12 0x20 or 32 bytes.
                      • When writing code, I usually use tabs in an editor which I can configure to output whatever is desired, but I’m hitting that tab-button instead of the space bar. Even in languages where the number of prefix-spaces can be any random number, I still hit tab most of the time and trust my editor to convert tabs to spaces where needed.
                      • In the end I really just don’t care and I think this is kind of a non-discussion, because we have plenty of tools that can fix this for us. So if the language you are using is not depended on whitespace (python and Haskell are, but Java, C/C++ etc are not), then just use tabs and let the individual coder do whatever he or she prefers.

                      However in defence of spaces:

                      • Everything always looks the same way and as intended without any effort on just about every machine.

                      I just don’t see why this should still be a problem or even a discussion in 2019.

                      1. 16

                        If that is the case, get out of your bubble and into the real world where you can encounter

                        That’s going too far. I’ve met tons of programmers in lots of spaces. This site was the first site I learned stuff about blind or visually impaired programmers. This is the first time I’ve heard about this issue. My favorite use of the a11y tag so far. A charitable position is to just assume others might have not run into the same people or read the same articles as you.

                        1. 5

                          Fair enough….

                          However, I ran into visually impaired CS students immediately in my freshman year of university. And there was at least one visually impaired student in each year. In fact: There were cohorts in which we had more visually impaired programmers CS students than we had female CS students. So I’ve been thoroughly aware of these issues, right from the start of my career.

                          1. 4

                            While I had met a few Deaf students during my studies at my university, I never met any blind person. My university also had an active Deaf culture, and I am familiar with their accessibility requirements. Perhaps people with different accessibility requirements choose the university more well known to have catered to people with similar requirements.

                            1. 3

                              That’s really interesting. I’d have not expected that.

                              1. 5

                                Maybe that is because my university had the facilities to accommodate visually impaired students at the science department. It’s something only the bigger ones can afford. And then they have to be willing to go the extra mile as well.

                                Anyway: All I can say is that there seem to be more visually impaired programmers then one would expect if one were just to take a random sample of people from the general population.

                                1. 9

                                  This, this, this. People often think disabled people don’t exist or are very uncommon in a space or discipline, not because it’s inherently so, but rather because the spaces those people have been in aren’t accommodating to disabled people, and so those disabled people went elsewhere! (Grumble grumble something about my school saying we didn’t need elevators because no disabled students attended anyway.)

                                  1. 2

                                    Sometimes the issue is just plain and simple economics.

                                    The costs of retrofitting an old building, if possible at all, with elevators are often prohibitively high. Even more so if the building is constructed from concrete. That probably plays a role as well when a statement like that is issued, but is left out by the speaker. This is because the speaker often assumes that the listener has the same background information as the speaker has, which is often not the case. This idea probably has a name already, but I am not aware of it. This is why empathy and the ability to read between the lines correctly, without making unnecessary assumptions are vital skills.

                                    1. 3

                                      Believe me, as the former treasurer of the student disability advocacy organization at Beloit College, I’m well aware of these economic factors. I was merely using that as another example of the effect you mentioned.

                          2. 11

                            blind people, whom perceive the digital world through a Braille-display

                            Side tangent: I’ve never known a blind person in tech with a Braille display. Everyone I know uses Jaws, ZoomText or some other screen reader and headphones. One of my friends said he never liked Braille displays; how they were super expensive and didn’t work well with a lot of the software he used.

                            The only place I’ve actually seen one of these was in the movie Sneakers.

                            1. 1

                              I have a (fully) blind relative which uses one for all interaction with a computer in combination with headphones and screen readers. It is apparently nearly impossible to type a regular letter or e-mail without a Braille display. The smartphones are the exclusive domain of just screen readers and voice typing though.

                              1. 1

                                Wait a minute, can’t blind people just touch type on a regular keyboard? I mean, I’m not blind, but that’s what I do. I arguably correct my errors faster, because I can see them on screen, but they could be nearly as fast by hearing their typos. Couldn’t they?

                                1. 2

                                  That doesn’t work in a lot of cases, like coding or excel spreadsheets for example. Then there is also the fact that a moderately skilled reader, can read about 2 to 3 times as fast as they can process the text by hearing. Truly skilled readers can read about 5 times as fast. Screenreaders are capped at what our human auditory systems can process and visually impaired people can stretch the capabilities of their hearing to about 1,5 to 2 times the regular speed by setting the screen reader to a faster setting, but that still means they are capped at what the average person can achieve.

                                  If you provide them with a fast Braille display, that bottleneck disappears and then they can become as fast as regular people, provided that they did put up the required practice.

                                  1. 1

                                    There’s the thing I don’t understand: how does a Braille display helps you type? You don’t need insane reading speed to process the 120+ words per minute you’re typing. Which would be a very high typing speed, but nevertheless slower than normal speech speed. And screen readers generally are even faster. The only way audio feedback could be too slow to keep up with your typing would be if you’re steno typing.

                                    If you’re using a Braille display, you need to move your hands to the keyboard to type, and move them again to read what you just typed. And you can’t do them at the same time. If you’re using an audio feedback, you could hear what you’re typing, without any switching.

                                    But I’m speculating here. How does your relative actually write text?

                                    1. 4

                                      First you’ll need to know that these devices usually provide multiple functions and that some of these Braille displays double as a Braille typewriter while others purely function as displays for computers, which are to be used in combination with a regular keyboard. Take a look at those links, you can get a general idea of what the workflow looks like by just looking at the pictures.

                                      If you have a display that also lets you type in Braille, you can simply type out your characters that way and the corresponding characters will appear on the display and in the text file of the document. In this case the thumbs serve as the fingers that can be used for “reading”, just like you would use them to press the space bar, but some people also move their index fingers back an forth.

                                      The display-only versions are basically used in a similar fashion and take the place of an RSI palm-rest below the keyboard.

                                      The small buttons below the Braille cells are shortcuts which can position your text cursor immediately at that place of the specific character of the cell above so you can edit it. The other buttons are directional d-pads which are used to move the cursor around much like the regular arrow keys on a regular keyboard do, while the other buttons can be used to move through the lines of text on screen in four dimensions like next line, previous line, move contents of display 1 character left/right or move contents of display 40 characters left or right etc.

                                      Visually impaired people can obviously touch-type, but that does not mean that they magically make less mistakes than we do. Then there is also the fact that screen-readers often mess up on pronunciation, or are downright incapable of dealing with a lot of edge cases.

                                      And there is also the “reading” aspect that these devices enable. A lot of content is available in some form of digital text, but not in audio-book format (although this has gotten a lot better in de last 20 years). With a display like this, you can give a visually impaired person access to the entire internet and just about every webpage (as long as it’s low on JavaScript), text-file, epub or pdf out there.

                                      The only real downside to these displays is that that are very expensive (about $3000 - $5000 depending on the version you are using) and that they are simply inaccessible to everyone without proper healthcare insurance.

                                      1. 2

                                        Okay, looks like the dual keyboard/Braille display is actually a chording keyboard. That kinda changes everything. Thanks for the lesson.

                                        1. 1

                                          Okay, looks like the dual keyboard/Braille display is actually a chording keyboard. That kinda changes everything.

                                          That’s just one of the possible setup you can combine though.

                                          Thanks for the lesson.

                                          You’re welcome.

                              2. 1

                                From what I understand, Braille displays are much more common in Europa than the United States.

                                1. 2

                                  Ah yes, all those braille displays on europa.

                                  1. 1

                                    I know your reply has a sarcastic undertone, but ironically, you may be right on this one due to the difference in healthcare insurance between Europe and the United States. See my remark above. Funny enough it are American companies that usually produce these displays.

                                    1. 4

                                      I suspect his reply was a sarcastic way of pointing out that in English, Europa is a moon of Jupiter (and is, as far as we know, not colonized).

                              3. 4

                                Are the spaces people just now figuring this out?

                                Some of us, yes. But that’s privilege for you: you don’t know you’re blinkered until you do.

                                1. 4

                                  Don’t take this personally. A few hours ago the post was accompanied by a request from the poster which said something along the lines of: “I found this on hacker news, I want to know what reactions this community will provide.”

                                  I wrote my reply with that in mind.

                                  1. 4

                                    Oh, I didn’t, but thanks for clarifying! :)

                                    1. 4

                                      The text was edited by the moderators; It was not my intention to mislead.

                                      1. 2

                                        I suspected that much. No offence taken…

                                  2. 1

                                    Just out of curiousity, in what situations would it be advantageous to look at a hex dump of your source files instead of your source files in textual representation?

                                    1. 1

                                      I encountered this situation once when I was providing support for a server with a bunch of php scripts on it, where one of the files would not execute properly. It turned out that the file contained an UTF-8 byte order mark that was causing the problem. I discovered this by pushing the file through xxd and I noticed that the sections with spaces were less easy to interpret than the sections with tabs.

                                      But I’ll admit, that this is not a situation you will run into often and that I just threw it in because it randomly popped up in my mind.

                                  1. 1

                                    are they offering HTTPS yet - i would like to move away from GitHub if possible

                                    1. 10

                                      …SourceHut has had HTTPS for all services since day one.

                                      1. 2

                                        push and pull?

                                        1. 7

                                          Oh, no. We support git pull over https, but not push, because SSH is the more secure of the two options. This is a deliberate design decision, not an oversight.

                                          1. 1

                                            are you willing to lose users by not having HTTPS support? cause thats what is happening in my case

                                            HTTPS might be less secure, but it does does offer some security.

                                            do you have some underlying reason for being obstinate about this? is it cost?

                                            1. 9

                                              @SirCmpwn is famously stubborn about these things. See also discussions about styling and why if your monitor is the wrong size (e.g., normal) everything is awkwardly left-justified.

                                              For what it’s worth, that stubbornness is likely also going to result in a refusal to compromise on the more important technical issues that could hurt security or performance.

                                              Edit: also, to somewhat voice support for the SSH point of view–being able to revoke authentication on a per-host basis (or possibly to improve automation) is really quite handy. The alternative for scripting with https upstreams is putting the credentials in the URL (which is gross and stored in plaintext), or other hashing that eventually makes you just wish you’d used ssh in the first place.

                                              If it helps, I can send you the private key and passphrase part of this one (generated with ssh-keygen -b 4096 -t rsa -C noname -f throwaway):

                                              ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMR82IOcor4hdiyeBIDQC/x0ubPVrVFw3zuPLvtXBQQsqD7znRHSsJAlNLD9iPtUdxjj2HjyLLfHrNAa0/iXPQStL5ErtK5+UqVq4seQCoyuakZoWGhmDKb3UAphiwLBuNQYdr/cJ7gLHNxN06thpEbx9pRG4jex1vb8DUfjgDdD5IEb859/pSoY5CTjni4Z+ZKllaCfrQgHNy/tYowxzjNa1HjJnR1SwqDNPrGgF4tJK+zXE4zbQcL3winIrNnvuBzGQmt36x6B6mQSEH32k/L8BAKAegP3CK8DZn9G0pi53Gj9arGYdY23jAT6fUeuAN87iggNo6NT0+jILMFt2rdPMiZj3KnVGcMdQEEqlX9sCw1jTe6v+n8d9wf2VFz45mU3ThrSmzSkyUNvhRV7RwJ6vRVgJ7LuOLZu1PByFMnVG5t5Hc8enS7MrD3bJNHn0q7lX5MBYFBSGbdozu7kY/Pyj/mxd3RNxEoXNmQ7JcolZiDxqGkRaanLDGEBzyLCitJAat30VkBnI/VKSN9jrmygNkg0LTKHY8rxtKZVHmUlDQF6Xuj4O9X7kJ2Xc/ov+dGl0ad38jH0bRtEtoKsGhY53Nw7d43bpOkh7Nhv40KaJVB4XUP23aGgkUDrdoVHyyxu3tqk+8dr1+YdrtwG3gUN8iliu6kSEzwlvhNMN89w== noname
                                              
                                              1. 13

                                                It’s not about cost. It’s about choosing the right tools for the job. HTTP Basic auth is the wrong tool for this job. I don’t want you transmitting your password over the wire, git.sr.ht doesn’t even know your password (or its hash). Why is SSH such a showstopper for you?

                                                1. 4

                                                  Why is SSH such a showstopper for you?

                                                  Not the OP, but my company doesn’t allow SSH out of the enterprise (I work in government where the company is several thousand employees). Thus anything that doesn’t offer HTTPS push is a no-go. I know of several other companies off the top of my head with similar restrictions.

                                                  1. 1

                                                    I remember how much I hated SSH when I first started by using GitHub 8 years ago. It’s an unnecessary complication. If users want the extra security SSH is available, but it shouldn’t be the only option.

                                                    1. 26

                                                      Sorry, SourceHut is probably not for you.

                                                      1. 20

                                                        A couple of thoughts from me in my capacity as the founder and (very much former) lead dev on Kiln, another Git/Mercurial SCM from around the same time GitHub launched.

                                                        First, I’m really with @SirCmpwn on this. Kiln supported pushing and pulling over HTTPS, but only because we targeted Windows users—and even then, only because Windows SSH clients were really rough at the time. If I were writing Kiln today, I really doubt I’d add HTTP push support. I might’ve added support for it eventually anyway in that parallel universe, who knows, but I definitely wouldn’t have kicked off with HTTPS push at launch.

                                                        Which brings me to:

                                                        I remember how much I hated SSH when I first started by using GitHub 8 years ago.

                                                        I really appreciate that SSH can be tricky, but I’m disappointed you’d let an impression you had in 2011 unilaterally cause you to reject the tool in 2019, regardless of what platform you’re on. TortoiseHg, Tower, Git for Windows, SourceTree, and tons of other tools have made handling SSH straightforward. It may still be too complicated for your comfort, but I’d be really hesitant to judge any technology on how it was eight years ago.

                                                        I’m also genuinely a bit surprised that you’d be willing to move your entire workflow from GitHub/GitLab/etc. to Sourcehut, but the idea of configuring SSH would be your dealbreaker. Moving CIs, reconfiguring users, porting bugs, moving mailing lists, etc., is all more time consuming and more error-prone than configuring SSH.

                                                        1. -2

                                                          I’m also genuinely a bit surprised that you’d be willing to move your entire workflow from GitHub/GitLab/etc. to Sourcehut, but the idea of configuring SSH would be your dealbreaker.

                                                          Good point, but my workflow is currently “low impact”, so it would be an easy move:

                                                          Moving CIs,

                                                          dont use them currently

                                                          reconfiguring users,

                                                          just me currently

                                                          porting bugs,

                                                          yeah that would be annoying - but my top 4 repos have a total of 17 issues, so nothing earth shattering.

                                                          moving mailing lists, etc.,

                                                          dont use those, for smaller projects its just redundant to github issues.

                                                          is all more time consuming and more error-prone than configuring SSH.

                                                          so you can see in my case if i could just find a decent site without the github feature bloat i would be happy to move. but currently sourcehut it not that option. yes SSH is more secure. but you know what? i dont care. maybe HTTPS will bite me someday and i will get hacked. but in 8 years it hasnt happened so i am happy to continue playing the odds. i am not happy with a site owner that refuses HTTPS not because of money, but because of some righteous insistence that SSH is the one and only way that is acceptable.

                                                          1. 4

                                                            yes SSH is more secure. but you know what? i dont care.

                                                            So, fine, this is your life… but also you should be aware that your practice isn’t common practice, and it’s worse than the common practice of using ssh keys in almost every way. You should expect to encounter more resistance to your approach over time.

                                                            Like, you can write your Windows 10 GUI software with php-gtk, but you’d be part of a rapidly diminishing minority. You’re right that you can’t use it to add things to the task tray, but if that’s what you want to do you’ll be far better served using a different, more popular toolset.

                                                        2. 1

                                                          I really don’t understand what there is to hate about it. As a user experience, it’s not much different one way or the other, aside from the initial setup.

                                                      2. 1

                                                        are you willing to lose users by not having HTTPS support? cause thats what is happening in my case

                                                        I don’t understand. What do you need that for?

                                                      3. -1

                                                        Something like randomly generated repository specific https passwords may be interesting. Though even that is probably also just be a less secure complication.

                                                1. 4

                                                  musl libc: a project with no hype but huge impact musl libc is an alternative to GNU libc for Linux, created by Rich Felker, and with a healthy community of high-quality contributors. It’s been around for years, yet making less than V in donations.

                                                  musl is super-great, without a doubt.

                                                  In other, semi-related news: GOOG wants to add a libc to llvm, apparently for the sake of Fuchsia. It doesn’t sound like the initial scope is intended to match musl or glibc. But I wouldn’t be too surprised if it got there within a few years.

                                                  I love to hate on GOOG for abandoning convenient service offerings, but they definitely do some good open source stuff. Andrew’s pledge to support musl (and others’ in-kind pledges) is/are laudable. But it’s good to know that there’s commercial support of open source projects, too.

                                                  EDIT: lobsters discussion of the llvm libc here

                                                  1. 3

                                                    It’s not for fuchsia; someone from fuchsia, apparently as an outsider, came in and said ‘that would be useful, can you make an aarch64 port?’

                                                  1. 6

                                                    “Morgan and I’s relationship” is proof that we’ve gone too far snapping at people for using “and me” or “me and”

                                                    The trusty shortcut is to cut out the other person: “I’s relationship” vs “my relationship”

                                                    Well, now I’m that person. Apologies.

                                                    Oh and uh yes congratulations and whatnot :)

                                                    1. 4

                                                      lol :)

                                                      1. 2

                                                        I would probably just say ‘the relationship of Morgan and me’ or something like that. Or ‘Morgan and I celebrated our 10 year wedding anniversary’ and refer to it as ‘our relationship’ from then on.

                                                        1. 2

                                                          Yes, everyone’s fourth grade teacher repeatedly insisted we not say “me and x” without any intelligent explanation of how the grammar actually works.

                                                          It’s really the same as factoring. 2(x+3) = 2x + 2(3) -> My relationship + Morgan's relationship = My and Morgan's relationship. The relationship of me + of Morgan = of me and Morgan.

                                                          Another thing many people don’t realize is that there’s nothing at all stopping us from switching the order of the (pro)nouns. Morgan and me, me and Morgan, I and Morgan, Morgan and I.

                                                          1. 1

                                                            “Abstract algebra to explain grammar” is something that would only happen here. Never change Lobste.rs XD

                                                        1. 30

                                                          Able to translate arbitrary C/C++ code to V

                                                          I’m sorry, writing a C++ compiler is essentially impossible unless you have the GDP of a small country, or you’re just building a wrapper around gcc or llvm. Translating C++ into anything other than C++ is even more ludicrous.

                                                          That promise combined with the 400k promise should be enough to tell how much of a lie this is.

                                                          I wish this were true, because D does try to be somewhat C++ compatible, but it’s very difficult to catch up. If anything could interop with C++ the way they do with C, that would be a huge, big deal. I really wish there was some easy upgrade path away from C++, but this is a fantastical creature that doesn’t exist.

                                                          1. 19

                                                            TBF, walter bright wrote a c++ compiler on his own. On the other hand, walter bright is also very good at writing compilers, it was a very old version, and no one else has done it.

                                                            1. 3

                                                              True about Walter. Were there no others? I suppose Watcom was developed by a group (aside/wool-gathering… Used v10.x circa 1995 on Win NT 3.5 and OS/2, I still have a 1997 boxed edition of v11 from when they were owned by Powersoft).

                                                              1. 2

                                                                He wrote a C++ compiler on his own… last century. C++ has grown a lot since then.

                                                                1. 3

                                                                  it [c++] was a very old version

                                                                  I mentioned that

                                                              2. 7

                                                                Translating C++ into anything other than C++ is even more ludicrous.

                                                                It was one of the things that made me call bullshit fast. You might be overstating the difficulty, though. The ZL language was a C++-like language that translates to C using one person working for a few years. I’m assuming the author worked part- or full-time for several years on that. Doing what V author describes wouldn’t take that big of a pile of money given what Atkison built.

                                                                Also, aside from a wrapper, they might just use one of the tools that parse C++ before doing their own stuff from there. Both compilers and program analysis frameworks can do a lot of heavy lifting. Going from an ultra-hard job to a really-hard job.

                                                                1. 3

                                                                  Swig translates C++ into a bunch of other languages. But it only translates C++ declarations into FFI code in the target language, and I don’t think it works for 100% of C++.

                                                                  1. 4

                                                                    Yeah, D also has a somewhat comparable level of interop with C++. If your templates get slightly complex, well, that’s as far as your interop goes.

                                                                    It’s a rather hopeless task to really have all of C++; even the actual compilers have trouble keeping up.

                                                                1. 1

                                                                  Generally, there’s a way to ‘work-around’ warnings like that on a case-by-case basis. For instance, [[fallthrough]] (or __attribute__((fallthrough))) for fallthrough in switch; or if ((a=b)) instead of if (a=b). Will there be such a thing for this? If what I actually want is 2^32? I saw proposed in the thread that the warning shouldn’t be present for hex/binary literals, but I don’t consider that a full solution.

                                                                  1. 2

                                                                    If what I actually want is 2^32?

                                                                    2^32 == 2 | 32, so why not just use the latter?

                                                                    1. 1

                                                                      10^7 != 10|7, so what do you do there?

                                                                      1. 2

                                                                        It’s 13.

                                                                    2. 2

                                                                      It is hard for me to imagine a use-case for 2^32, and very easy for me to imagine use cases for 1 << 32; when are you thinking you would use int-constant '^' int-constant? I could see xor-ing bitfield flags or something, but then usually you’re doing something like MASK1 ^ MASK2 using names instead of literals.

                                                                      1. 1
                                                                        #include <stdint.h>
                                                                        #include <stdio.h>
                                                                        int main() {
                                                                           printf("%u\n", UINT32_MAX);
                                                                        }
                                                                        
                                                                      1. 6

                                                                        I don’t understand the use-case for this. Why would I want a framework for my prompt? What would I want to put there that would require a framework?

                                                                        1. 12

                                                                          It appears to be a ‘framework’ for building/customizing prompts, which I think is quite cool (making zsh promts using zsh’s built-in prompt format stuff is really annoying).

                                                                          1. 1

                                                                            ¯\_(ツ)_/¯ it hasn’t really been that annoying to me. Maybe my prompt is just not complex enough, but again, I don’t know what kind of complexity you would want in a shell prompt.

                                                                            1. 2

                                                                              A quick glance through the examples seem to indicate it’s mostly about setting colors.

                                                                              For what it’s worth, the project Readme is pretty damn good. It has screenshots, examples, and a capsule documentation.

                                                                              1. 4

                                                                                Sure, setting colors, text/symbols, etc. It was meant to be a pet project anyway, for me to learn Nim and get rid of oh-my-zsh altogether. And thanks! I take special pride in my documentation.

                                                                                1. 1

                                                                                  Fair enough. I used nim to make an exact clone of another IRC bot I’d made.

                                                                                  (Although, I can’t see the point of oh-my-zsh, either.)

                                                                            2. 1

                                                                              I’d find it far more annoying to have to carry around some framework . I setup my zsh prompt 25 years ago and have barely touched it since. I don’t especially remember it being particular annoying or tricky to do.

                                                                            3. 2

                                                                              I mean, yeah, the use-case isn’t all that much. Generally, customizing your prompt is a one-time thing. This project draws inspiration from Sindre Sorhus’ pure. Just wanted to write a Nim implementation of something similar… and this is what I ended up with :)

                                                                              And the word ‘framework’ is the best thing I could think of to describe it.

                                                                            1. 4

                                                                              The postulate of ‘use your whole brain’: that you have a ‘math side’ and a ‘language side’ irks me. I relate to math and language in the same way: through language. Symbolically. Well, I still write comments. I still think they’re valid, and super useful, but I don’t relate to them in a fundamentally different way than code the way the presentation seems to suggest.

                                                                              1. 2

                                                                                Yeah as far as I’m aware there’s no evidence to suggest that the popular notion of having a math side and language side of the brain has any relationship to the actual structures of the human brain. Expressing the same concept in multiple ways by writing comments next to the code might well be genuinely useful for reducing the defect rate, but I’m put off by making too much hay out of that specific bran hemisphere metaphor.

                                                                                1. 1

                                                                                  That’s a fair point; I, too, think of maths and code in large part through the filter of language. Then again, I definitely express myself differently when I limit myself to the vocabulary and idioms of maths or code, versus when I use language to get an idea across.

                                                                                1. 2

                                                                                  Anyone know why this isn’t running anymore?

                                                                                  1. 1

                                                                                    Can we please tag this “Lisp”

                                                                                    1. 2

                                                                                      It’s up to users to suggest tags - check the “suggest” link near the title.

                                                                                      1. 2

                                                                                        I don’t know if it is lisp, some people think lisp means common lisp specifically. Janet is it’s own language, I guess it is in the lisp family.

                                                                                        1. 2

                                                                                          To me, if I see “paren soup”, then it’s lisp.

                                                                                          1. 0

                                                                                            Some people can’t tell the difference between Japan, Korea and China either.

                                                                                            1. -1

                                                                                              If you have a better tag for “unreadable langauges with too many parenthesis”, let me know

                                                                                              1. -1

                                                                                                Your loss, enjoy javascript and bash.

                                                                                                Btw, count semantic parens:

                                                                                                Janet:

                                                                                                (fn [] (print "hello"))
                                                                                                

                                                                                                Javascript:

                                                                                                function () { print("hello"); }
                                                                                                
                                                                                                1. 0

                                                                                                  No one writes functions in JavaScript like that. They do it like this:

                                                                                                  const aa = function(bb) {
                                                                                                     console.log(bb);
                                                                                                  };
                                                                                                  

                                                                                                  Or:

                                                                                                  const aa = function(bb) console.log(bb);
                                                                                                  

                                                                                                  Or:

                                                                                                  const aa = bb => console.log(bb);
                                                                                                  
                                                                                                  1. 2

                                                                                                    const aa = function(bb) console.log(bb);

                                                                                                    In all my years of using JS, I’ve never seen function without a {} block.. and indeed for a reason:

                                                                                                    SyntaxError: missing { before function body
                                                                                                    
                                                                                                    1. 1

                                                                                                      Still same number of parens though (except for the last one).

                                                                                                      1. 1

                                                                                                        the point is that with lisp, every paren deepens the nesting. that doesnt happen in any of the JS examples…

                                                                                        1. 5

                                                                                          does Perl 6 have a REPL? that is one of the reasons I dont use Perl 5

                                                                                          https://rt.perl.org/Public/Bug/Display.html?id=133969

                                                                                          1. 9
                                                                                            1. 3

                                                                                              It has. Doesn’t have tab completion or syntax highlighting or anything like that, but has lineediting with linenoise/readline, generally seems to work fine.

                                                                                              1. 3

                                                                                                I haven’t used Perl in a long time, but there are Perl 5 REPLs in CPAN. Not as convenient as having one built-in, but shouldn’t be a show stopper.

                                                                                              1. 20

                                                                                                I’m confused by this post.

                                                                                                A github fork is a convenient UI over git’s branches. You create your own personal copy of the repository and the github platform does some configuration that allows you to use their nice UI for allowing them to merge your branch/changes even if you don’t have write access to the project. They have a nice UI for doing the commentary and reviews etc.

                                                                                                Nothing says you have to use this. You can do bare git stuff, ask for write permissions, push your changes etc. etc.

                                                                                                This post is complaining that github adds a value - for most users - by giving them a easy to use UI over git.

                                                                                                1. 14

                                                                                                  The article is mostly about how github has overloaded the term ‘fork’, giving it the same meaning as a traditional personal repo copy. Forking a project, as the article mentions, is taking it and giving it new life as something else, without necessarily contributing changes back to the original repo (article gives the example of the ffmpeg –> libva forking).

                                                                                                  Github is taking well-established terminology and giving it new meaning in their proprietary platform, which causes confusion.

                                                                                                  1. 9

                                                                                                    The article is mostly about how github has overloaded the term ‘fork’, giving it the same meaning as a traditional personal repo copy.

                                                                                                    It’s somewhat difficult to take this complaint seriously considering the article then proceeds to do the exact same thing by using the term “branch” to mean “clone of a git repo” instead of the already existing meaning of “branch within a git repo”.

                                                                                                    Either pedantry over terminology is a big deal or it isn’t (my take is that it really isn’t), but the author needs to pick a lane.

                                                                                                    1. 3

                                                                                                      Your application of branch is too specific and tied to the idea of a canonical upstream repository. Cloning is the process of creating a local branch which mirrors a remote branch. The end result is still a branch.

                                                                                                      1. 9

                                                                                                        Your application of branch is too specific and tied to the idea of a canonical upstream repository.

                                                                                                        Not at all, it’s merely tied to the semantics of git, the DVCS under discussion here.

                                                                                                        Cloning is the process of creating a local branch which mirrors a remote branch.

                                                                                                        Cloning creates a local copy of a remote repository and (typically, unless you do some things to restrict it) all branches within it. Creating a local branch which mirrors a remote branch is not a clone operation, it’s a git fetch —track.

                                                                                                        It’s incorrect to describe a fetch as a clone. It’s incorrect to describe a repository as a branch. These are all distinct concepts in git, with different semantics, regardless of whether or not your development model involves a canonical upstream or not.

                                                                                                        1. 2

                                                                                                          I’m definitely simplifying things a lot, and I appreciate your clarifications. But my point is that you end up with your own “master” branch, which is discrete from the other branch. The repo is just a container for that branch, no matter where you have it pushed. The key distinction between your repo and the other repo is the branch you’re doing your work on. Thus, I think branch is a valid term to use here.

                                                                                                    2. 13

                                                                                                      Which possibly is an over load of “forking processes”, which possibly is a overload of the term “fork” meaning a thing with multiple prongs. “clone-ing” a repository relates to “A clone” of something and so on. Language is malleable.

                                                                                                      Github forks allow you to neatly merge back to what you forked from. Again, you don’t need to use this. I think this is just a bad argument.

                                                                                                    3. 9

                                                                                                      I think it’s easier to understand the implicit criticism by wondering about how Github would have been if it wasn’t based around forking a project to contribute to it. Currently the data that is used to create a pull request – in addition to the reference to which you want to contribute changes – is the name of your personal fork, and of the branch you want to send.

                                                                                                      Now if forks were not pervasive, how would people be able to contribute to projects on github? Well, either they would have to indicate the URL of a full git somewhere (and a branch name), or they would submit to github a series of patch (by sending an email, or by uploading git format-patch files, etc.).

                                                                                                      Those two models are not much harder to implement than the current forking model, and/but they immediately make github a partially federated platform, making it easy to contribute to a github-hosted project without yourself being on github or hosting your personal working copy on github.

                                                                                                      You can see how that is not much less convenient for users, and how it makes it much easiers for users to migrate to another platform.

                                                                                                      Personally I’m not at all surprised that github is not interested in supporting these less-centralized workflows, but I am a bit disappointed that Gitlab has not yet invested much effort in supporting them. Contrarily to github, there are many instances of Gitlab (the free version) around, and merge-requests-across-instances would be directly useful to me today. In fact, there are some instances that I avoid using specifically because they restrict account creation (or creation of new projects for untrusted users), which kills collaboration in a fork-centric model. (See gitlab issues #4013, #260, patch by email #40830).

                                                                                                      1. 8

                                                                                                        Now if forks were not pervasive, how would people be able to contribute to projects on github? Well, either they would have to indicate the URL of a full git somewhere (and a branch name), or they would submit to github a series of patch (by sending an email, or by uploading git format-patch files, etc.).

                                                                                                        But “Github forks” being pervasive does absolutely nothing to prevent you from continuing to do just this?

                                                                                                        Unless the complaint here is “if I email a patch to a maintainer, they complain that it’s a PITA to deal with and ask me to just submit a PR”, in which case…

                                                                                                        You can see how that is not much less convenient for users

                                                                                                        I’ve worked in both models, I strongly disagree.

                                                                                                        Federation is great. Emailing patches around sucks a ton.

                                                                                                        1. 2

                                                                                                          “matt” matt@lobste.rs writes:

                                                                                                          Emailing patches around sucks a ton.

                                                                                                          Having a fast tagging system like notmuch helps a lot, and doesn’t take much time to setup.

                                                                                                          1. 2

                                                                                                            Emailing patches around sucks a ton.

                                                                                                            I agree. However, after thinking about it a bit, @gasche’s comment made me wonder about a word where github supplied a “git-format-patch-pr” – similar to emailing patches, but which instead uploaded patches to github from a local branch into some ephemeral PR specific location. All this instead of having to create a fork and open a PR.

                                                                                                            1. 4

                                                                                                              The Phabricator workflow is pretty similar to what you’re describing: you can use arc to upload patches from a local branch. Or just paste diff output into a web form without even committing anything :D

                                                                                                              1. 1

                                                                                                                I like this workflow so much, but I couldn’t convince my co-workers of its qualities, because they (understandably) get uneasy about the fact that patches don’t have a clear “target” – and they can mean different things depending on what they are applied to. (If anyone has a suggestion for a solution for this, please contact me.)

                                                                                                                (So instead they keep using Bitbucket and adopt all kinds of terrible practises for the only reason that doing the right thing is made highly inconvenient by bitbucket.)

                                                                                                              2. 2

                                                                                                                Emailing patches around sucks a ton.

                                                                                                                I agree. However, after thinking about it a bit, @gasche’s comment made me wonder about a word where github supplied a “git-format-patch-pr” – similar to emailing patched, but which instead uploaded patches to github from a local branch into some ephemeral PR specific location.

                                                                                                                I wonder if it would be considered rude to simply attach a patch to the relevant github issue..? Or link to a patch stored on a paste service like ix.io? You can add to github issues over email, so with this method you could sort-of submit patches over email, bypassing the whole PR interface.

                                                                                                                1. 2

                                                                                                                  Worth noting that, while it doesn’t stop you from needing to make a fork, you can retrieve a .diff or .patch from any comparison: https://github.com/microsoft/VFSForGit/compare/features/linuxprototype...github:linux-gvfs-provider.patch

                                                                                                            2. 5

                                                                                                              A github fork is a convenient UI over git’s branches

                                                                                                              Not in my experience. It usually consists of:

                                                                                                              • Patch my clone
                                                                                                              • Try to push
                                                                                                              • Get permission denied, since I forgot that I don’t “own” the remote
                                                                                                              • Go to the GitHub page
                                                                                                              • “Fork” the repo
                                                                                                              • Edit .git/config, or try to remember what the git remote commands are, to change origin to my “fork” (I usually keep the previous remote as upstream, since my “fork” will inevitably fall behind and need regular pulling and pushing)
                                                                                                              • Try to push again
                                                                                                              • Go back to GitHub and use the “pull request” UI
                                                                                                              • Add a comment to the pull request that links it back to the “issue” that caused me to make the change
                                                                                                              • Try to keep track of both threads of conversation, until the patch gets merged
                                                                                                              • Have a small existential crisis as I debate whether to delete this “fork”, to cut down the hundreds of repos I have to wade through; or whether I should be a good Netizen and preserve the URLs.

                                                                                                              Phew!

                                                                                                              1. 3

                                                                                                                Afaik you don’t have to change the upstream, you can just say git push <alternate upstream>. I might be wrong about that, though; might be confusing it with git pull. Also, afaik deleting the ‘fork’ is standard practice; you aren’t really contributing to linkrot that way, because you’re not erasing any content, and no one is linking to such a fork.

                                                                                                                To be clear, I still think the github pull request ui is awful, but ^^^ is my understanding of how it works.

                                                                                                                1. 3

                                                                                                                  Indeed, git push takes either a URL or remote name as its first numbered argument. Sometimes if I need to make a quick push to a remote I don’t use commonly, I’ll just detach HEAD, make commit/s, then git push git@wherever:whatever.git HEAD:remote-branch.

                                                                                                            1. 1

                                                                                                              “Even if superhuman artificial intelligence was somehow created, there’s no way of knowing that they’d be of much use to us. It may be that intelligence is not the biggest bottleneck to our current problems, but rather time and resources.”

                                                                                                              “One of the most misunderstood ideas that’s polluting the minds of popular ‘intellectuals’, many of them seemingly accustomed with statistics and machine learning, is the potential or threat that developing an artificial general intelligence (AGI) would present to our civilization.

                                                                                                              This myth stems from two misunderstanding of reality.”

                                                                                                              “A second, more easy to debunk misunderstanding, is related to the practicality of an AGI. Assuming that our wildest dreams of hardware were to come true… would we be able to create and AGI and would this AGI actually have any effect upon the world other than being a fun curiosity ?”

                                                                                                              This man is wrong. The reason why I am going to write out this comment is because AGI is in my opinion the single greatest existential threat to human kind bar none. And as far as I can tell very few people are concerned about it. Most people are like this guy, dismissing totally both the possibility that AGI can be created and the possibility that it would be dangerous.

                                                                                                              He says that AGI can’t be dangerous because humans exist. There are too many holes in this to cover all of them. Human beings are very limited in their capabilities and they have empathy and other human traits that cannot as of now be removed or altered in any reliable or quantitative way. There is the odd sociopath, yes. Having 7B sentient entities that have no human frailties, empathy, etc would lead to a very, very different world than the one we live in right now. 2019 will be looked back on as a human paradise if AGI is not prevented.

                                                                                                              AGIs would wipe the floor with humans in any domain. The laws of economics and evolution demand that AGIs render humans jobless, powerless and obsolete. To deny that AGIs will take over is to deny every instance of natural selection that resulted in human beings. When a dominant life-form exists, it proliferates. This is because it only takes a small group of those dominant life-forms to seed an explosion of growth. In the case of AGI, it will only take one. It’s not that AGIs will wipe us out, it’s that they will render us transient. The only reason human society has covered the earth for so long is because every country and entity that won out over others was powered by human labor and intellect. Many societies have come and gone but they were all human. Soon, that pattern will continue but the winners will not use human labor or intellect, for the first time ever. And eventually there may be none left, like any other obsolete technology. This is not a Jetsons outcome.

                                                                                                              The reason why we as humans have even the limited rights, privileges and frankly luxuries that we do have is because we are a source of labor and signal processing that cannot be replaced by machinery or anything else. When that is not true anymore, things will not get better for humans — not in the long run.

                                                                                                              The current machine learning explosion is not the result of intellectual advancements. It is largely the application of old and established techniques and principles in a new environment where computation is very cheap. The ML revolution is mostly a result of cheap compute — the CEO of openAI has said it himself. My point is that in this new world of cheap compute, the ML we see now is the most obvious, naive use of compute. It is low hanging fruit. There is much, much more potential in that compute than people realize. Not through convention ML.

                                                                                                              There any many computers in the world. We are now seeing an emerging trend where the computational resources of these computers are being made available in a frictionless manner. It used to be you had to rent a server. Now you submit your app and buy a certain amount of compute or whatever. People buy compute to crack passwords. Web assembly is making all computers in the world able to run the same binary. Overall the trend is that cloud compute is arriving and it will make compute cheaper than ever before. Discovering AGI is a compute intensive task. When compute gets cheap and easy enough, someone will discover AGI. That threshold exists somewhere — maybe we already passed it. But the point is that it does exist somewhere. And all it takes is one AGI to design the next one and so on.

                                                                                                              There wasn’t much possibility of creating an AGI with vacuum tubes or discreet super computers. But now, for the first time in history, the computational substrate from which an AGI could spring will exist. We need to ask the hard question of whether or not that’s a good thing.

                                                                                                              The fact that AGI can’t be tested and understood is true and that’s why it’s so dangerous. We may not even realize it when we create it.

                                                                                                              1. 2

                                                                                                                I don’t think you’ve defended your point sufficiently. There is no reason to believe AGI is an existential threat, nor even that it has a self-preservation instinct.

                                                                                                                1. 1

                                                                                                                  What you are saying doesn’t make sense. AGI is a concept, “it” is incapable of having a self preservation instinct or any other instinct or any individual quality whatsoever. It’s implementations, however, are very capable of prioritizing self preservation above all else. AGIs will be created often and eventually one of them will. The reason AGI is dangerous is because all it takes is one. And that’s just one avenue for things to go wrong. We haven’t even discussed the implications of AGIs being used to augment the sentient entities that already exist.

                                                                                                                  You are right in the end because I have not defended my point well enough. It’s very hard to articulate what’s in my mind. If nothing I have said can make you see it, then all I can say is that I read and think about this topic a lot and have done so for about a decade now. It was only recently that I developed my current, negative view of AI. And nothing anyone has said has been able to touch this opinion I hold. When I see a weakness in one of my opinions I don’t overlook it. I’m pretty sure I’m right. And there is no other reason to believe what I believe other than thinking it is correct because it is an opinion that is very unpopular. And it’s also sad and painful to believe it.

                                                                                                                  1. 3

                                                                                                                    @dian, I wrote a comment to the parent of this this thread which I deleted as I didn’t believe it was helpful or constructive.

                                                                                                                    I reacted to this phrase:

                                                                                                                    AGI is in my opinion the single greatest existential threat to human kind bar none

                                                                                                                    and replied with a litany of other threats humanity faces at this point in time.

                                                                                                                    I realized this was disrespectful of your opinion. I’ll concede that if unrestrained, inimical AGI is developed or appears spontaneously, it can be a very real threat. However, I believe the probability for this happening is very low. Unfortunately, other threats have higher probability.

                                                                                                                    And there is no other reason to believe what I believe other than thinking it is correct because it is an opinion that is very unpopular. And it’s also sad and painful to believe it.

                                                                                                                    On a personal note, when I was much younger I was almost paralyzed by fear of nuclear war. This was triggered by popular media in the early 80s (The Day After comes to mind). I think I can emphasize with your point of view and concerns. But please, don’t let it become a negative force in your life. By all means, research the matter, keep an eye on research, and advocate for safety in AGI research. But don’t lose hope.

                                                                                                                    1. 3

                                                                                                                      Thank you so much for your kindness. I really do write these comments because I believe it’s important, not to provoke people or stir up trouble. I deeply empathize with people who, like you, struggled to reconcile with inevitable doom during the Cold War. Richard Feynman once said that after the bomb was completed, he became totally convinced that the world would end in nuclear fire. Soon after, he came across a building under construction and he could only ask why they were building when it was just going to be blown away in a nuclear blast. Regarding AI, it does seem pointless to build on some days but I have not lost hope because it may not happen in my lifetime and it’s a problem that is amazingly easy to avoid in theory.

                                                                                                                      I do respect your opinion and this kind of dialogue is the solution always, regardless of what the problem we face may be.

                                                                                                                2. 2

                                                                                                                  Please outline how an AGI will protect and maintain its electrical power to keep it going in the absence of (or despite of) humans.

                                                                                                                  1. 2

                                                                                                                    Bob: It’s OK, we shut down all the power plants and disconnected all the power cables to the mainframe, the evil AI isn’t going anywhere.

                                                                                                                    Alice: The power cables to the what?

                                                                                                                    Bob: To the mainframe.

                                                                                                                    Alice: It wasn’t on a mainframe, nobody uses mainframes! It’s copied itself to every data centre and ordered redundant power supplies for them all, we were trying to release a worm to patch people’s neural implants to - oh…

                                                                                                                    1. 2

                                                                                                                      Why specify “in the absence of humans”? Companies, which are not humans, can hire humans. AGI can do the same.

                                                                                                                      1. 1

                                                                                                                        Your argument depends on nobody ever giving an AGI control of any physical assets that it could use to manipulate the physical world. The reason that AGI is dangerous is because it would only take one instance of an AGI with a robot under its control to spark everything I’ve described, and it is not the only way to spark what I’ve described. AGIs, once it is understood how to create them, will pop up one after another. Eventually one of them will gain control of a physical embodiment somehow.

                                                                                                                    1. 1

                                                                                                                      Quickly translated to C++: https://gcc.godbolt.org/z/vZt-zv

                                                                                                                      gcc & Clang both perform similar optimisations. gcc -O produces the same instructions as gcc -O3.

                                                                                                                      I’m not familiar with amd64 assembly, but a main difference seems to be RyuJIT is treating the enum as 8 bits wide. So, with an 8-bit wide enum type in C++: https://gcc.godbolt.org/z/T31QMV

                                                                                                                      The constant versions of A & B optimise to the same assembly, but using different instructions to RyuJIT (gcc does shift argument right; and with 1 and RyuJIT does test bit; set byte register from result; movzx). Maybe someone who knows more about amd64 can say if there’s any practical difference at runtime.

                                                                                                                      The non-constant versions are different, similar to RyuJIT, and come out effectively the same I think (different calling conventions are maybe the only difference…?)

                                                                                                                      I’m guessing it would be a weird optimisation for g++ to notice that all the enum values are single bit values, so it can treat the two results (A&B!=0, A&B==B) as equivalent (it could theoretically notice this though, right? calling the function with an invalid enum value would be UB…?).

                                                                                                                      I would think[*] that the interesting thing about the non-constant version in a JIT is that if the JIT’s runtime can tell that the application is calling the non-const version in a tight loop with the same “value” argument every time then it should be able to inline the implementation for whatever “value” is, which is faster than any of these options.

                                                                                                                      [*] Without knowing much about JITting

                                                                                                                      1. 1

                                                                                                                        I would think[*] that the interesting thing about the non-constant version in a JIT is that if the JIT’s runtime can tell that the application is calling the non-const version in a tight loop with the same “value” argument every time then it should be able to inline the implementation for whatever “value” is, which is faster than any of these options.

                                                                                                                        I don’t know much either, but calling the function would still have to check if it had that value; that means an indirection which is way more expensive than the potential savings, for a function of this size. For larger functions, though, they definitely do optimizations like that.

                                                                                                                      1. 1

                                                                                                                        Aren’t tokens generally munched, not eaten?

                                                                                                                        1. 3

                                                                                                                          I use a tempfike name (‘tt’ in my case - inherited from my first Unix mentor, who may have got it from ATT. Anyone else use the same?). Any tt* file (tt.go, tt.json, ttt) can be.nuked at any time. If I want to keep it I rename. Naming is important, and.‘tt’ really just means “the current thing” to me….i.e. “it” in English or $_ in perl.

                                                                                                                          1. 1

                                                                                                                            I tend to use ‘fred’, it just roles off the fingers with a qwerty keyboard.

                                                                                                                            1. 1

                                                                                                                              Wait—really? Hah, I thought I came up with naming files ‘tt’.