Walter Bright Ports D To the Mac
jonniee writes "D is a programming language created by Walter Bright of C++ fame. D's focus is on combining the power and high performance of C/C++ with the programmer productivity of modern languages like Ruby and Python. And now he's ported it to the Macintosh. Quoting: '[Building a runtime library] exposed a lot of conditional compilation issues that had no case for OS X. I found that Linux has a bunch of API functions that are missing in OS X, like getline and getdelim, so some of the library functionality had to revert to more generic code for OS X. I had to be careful, because although many system macros had the same functionality and spelling, they had different expansions. Getting these wrong would cause some mysterious behavior, indeed.'"
As little as possible. From the article:
I then figured out how to remotely connect to the Mac over the LAN, and (the Mac people will hate me for this) put the Mac in the basement and operate it remotely with a text window.
A Mac is a genuine Unix workstation that is much easier to administer, and has much better software and hardware support than Linux.
I can run basically every Linux/Unix application on my Mac, both command-line and GUI, while not having to worry about wireless networking drivers, printer support, power management / sleep support on my laptop, getting accelerated 3D drivers working, or any of the other minor hassles that are involved with setting up and maintaining a Linux install.
If you walk into the computer science department at MIT, basically all the faculty have a Mac, and fully half the students do. These people are not buying Macs because they saw a cool ad on the bus - they're buying them because a Mac is the best tool available.
The argument that Macs are just expensive, "designer" PCs that look pretty and sell well because Apple has marketed them well doesn't hold water. Yes, they have nice hardware, and a clean, polished, slick UI, and that does make them more pleasant to work with than some blob of Dell plastic running Vista - but they have the functionality to back up their appearance, as well.
Yeah, they're more expensive. If you value your time at all, you should realize that spending an extra $100 on a Mac is well worth it if it improves your productivity. Hell, if you ever spend two hours fighting with some weird issue on your Linux box, it's no longer saved you any money. You know how long I've spent fighting with the OS to get my wireless working, or hibernate working, or whatever, in Mac OS X, in the five years I've been using a Mac? Zero. I'm not exaggerating. It lives up to the hype. It "just works". It gets out of my way and lets me get things done.
This space intentionally left blank.
I don't think D will ever have the high performance of C++, because D objects are all allocated on the heap. The D 'auto' keyword is just a compiler hint (last time I checked) to help in escape analysis. D has structs, but one has to design upfront if a class has value or reference semantics, and that creates a major design headache. Avoiding the headache by making everything have reference semantics negates the advantages of struct.
D is a mix of C and Java, with the C++ template system bolted on top. It is no way C++. D is not what a veteran C++ programmer excepts as the next generation C++.
So basically, Mac IS Linux on the desktop?
I think I've just given Linux fans nightmares for months.
Random Thoughts From A Diseased Mind (Not For Dummies)
Real developers actually use the Mac?
Of course. The MacBook and MacBook Pro are nice laptops for on the move, and it runs ssh, gcc, vi, emacs and X11 perfectly.
"Little does he know, but there is no 'I' in 'Idiot'!"
Because the compiler ignores whitespace it's probably not the best design decision to let a non-visible character be the end-of-line terminator.
Sound: multiple sound cards - eh ? ... well ... add them all to the address book :)
iChat: your router or ISP sucks. It works ok for everybody else.
e-mail: Clean your caches. This also works ok for everybody else.
Mouse cursor: either don't let direct daylight shine on the mighty mouse or throw that junk away and get a real mouse with a opaque body
Fax:
1% APY, No fees, Online Bank https://captl1.co/2uIErYq Don't let your $$$ sit in a no-interest acct.
Why would Mac people hate somebody for that? I ssh into my macs all the time. I pretty much always have terminal windows open. A lot of the molecular biology software I use (the open EMBOSS set of programs ROCK) are command line only, take files as input & write files as output. It's a BSD box with pretty paint. Sure, it's nice to have the pretty screens & be able to run things like iphoto & etc, but at the end of the day the most useful stuff still runs from the > prompt.
1984 was supposed to be a warning, not an instruction manual.
Nope. We have B, we have C and the one language to rule them all has source files ending in .PL
1% APY, No fees, Online Bank https://captl1.co/2uIErYq Don't let your $$$ sit in a no-interest acct.
I think the fact that this post has been up for almost an hour and has only 33 follow-ons shows what the software community thinks of D.
One has to acknowledge that Back in The Day, Walter Bright did all of us a great service in producing the first PC-based C++ compiler (Zortech) which effectively forced Borland and Microsoft to take the language seriously.
Unfortunately, for all of us, he seems to be better at invention than collaboration but that doesn't devalue the contribution he made (structurally) to get us to where we are.
cheers...ank
Still hoping for Gentle Treatment...
The griping and misinformation here is so atrocious that I'm simply embarrassed to be reading Slashdot today.
Digital Mars D is a wonderfully designed language and I'm in the process of giving up a lifetime of C++ for it.
I'm not here to defend D or enumerate it's growing pains or evangelize it, but if you don't take it upon yourselves to be well informed, please don't repeat your biased gibberish to the rest of us.
Okay. I'll amend my previous statement.
So basically, Mac IS FreeBSD on the desktop?
I think I've just given FreeBSD fans nightmares for months.
Random Thoughts From A Diseased Mind (Not For Dummies)
Linux is also UNIX on the desktop. It's just an oddball version of UNIX, with a whole bunch of extra APIs that people using Linux get used to and come to depend on, so they think writing portable code means "it runs on Red Hat and Suse" (or Debian and Ubuntu, if you're on the Left Hand path), and then when they go to port to a more standard version of UNIX, they write stuff like this:
If you're writing code that depends on the expansion of system macros, or if you're depending on obscure Linux-only functions, you're writing unportable code. What really bothers me is the idea that someone writing a Linux-only program would already have run into situations where they had to conditionally compile code. Has Linux really fragmented that much?
...or there's always Greek, Hebrew, Klingon* and, hey, Chinese (that should keep us going for a while)!
Why do you think they invented Unicode?
(*Fatal Error at line 16349: statement has no honour)
In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
I think I've just given FreeBSD fans nightmares for months.
You don't understand FreeBSD fans, then. Most of the FreeBSD users I know have Mac desktops. Jordan Hubbard works at Apple now.
Mac on the desktop, FreeBSD in the back office, it's a sweet environment and everything "just works".
People who have been Mac people for a long time generally don't have that workflow, as the importing of the BSD backend is a fairly recent addition to the Mac world, whereas many of the GUI conventions have been around much longer.
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
A Mac is a genuine Unix workstation that is much easier to administer, and has much better software and hardware support than Linux.
It has *better* software support from major ISVs, I will grant you that, but it does not have better software support generally and Linux supports far more hardware than MacOS. Not all Linux software runs on the macOS either.
My wife and son have macs, and I tell you, I'll take Linux every time.
I can run basically every Linux/Unix application on my Mac, both command-line and GUI, while not having to worry about wireless networking drivers, printer support, power management / sleep support on my laptop, getting accelerated 3D drivers working, or any of the other minor hassles that are involved with setting up and maintaining a Linux install.
I have a couple printers that don't work on my wife's, son's or mom's mac.
I have an AMD noname and a Dell desktop as well as an HP pavilion laptop, and I don't have any real problems. I have to use the unsupported nVidia driver, but that isn't too hard to install. Things like Skype just work.
If you walk into the computer science department at MIT, basically all the faculty have a Mac, and fully half the students do. These people are not buying Macs because they saw a cool ad on the bus - they're buying them because a Mac is the best tool available.
That is a fairly subjective statement of a dubious conclusion. Most of the guys that I have worked with use macs at work because the "organization" in which they work requires MSOffice which is not supported on Linux. They would rather use Linux or FreeBSD.
Yeah, they're more expensive. If you value your time at all, you should realize that spending an extra $100 on a Mac is well worth it if it improves your productivity. Hell, if you ever spend two hours fighting with some weird issue on your Linux box, it's no longer saved you any money.
I am less productive on Mac, and I've spent my time fixing macs as well. I have a standing free bottle of Wine from an upscale wine shop because I was able to get their printer working on their mac. They had been trying for months.
When it comes to productivity, lets see a Mac do this:
ssh -X hostaddr application
And have the GUI application pop up on a remote screen without the WHOLE screen like VNC.
in Mac OS X, in the five years I've been using a Mac? Zero. I'm not exaggerating. It lives up to the hype. It "just works". It gets out of my way and lets me get things done.
Its funny, EVERY SYSTEM has issues. People who claim they do not are lying. Like I said, my wife, mom, and son have macs. I've developed software on macs periodically for about 15 years. OS/X does have its issues. There are hardware issues on macs.
For average users I recommend mac because it has far fewer problems than Windows. For techies, there is no substitute for Linux or FreeBSD. (I prefer Linux, but I have friends who prefer FreeBSD.)
OK, whats with this unix love? Yes it is a unix workstation, but so is HPUX. HPUX is ...different. You will understand if you have ever used it.
Don't talk to me about HPUX, I'm still bitter about Alpha.
Being Unix compliant does not mean a OS is good, reliable, or stable OS.
Not being UNIX would mean that it doesn't matter how good, reliable, or stable it is... it wouldn't matter, I wouldn't be using it. I've done my time in the trenches dealing with VMS, TOPS, RSX, RTE-IV, MS-DOS, CP/M, Windows, AmigaDOS, Exec/1100, many of which were by all kinds of measures good, reliable, or stable. But dealing with different operating systems sucks rotting frog innards through used oil filters, and I'm too old for that kind of manure.
Being UNIX means that, if it also happens to be good, reliable, or stable (which it does), it's worth using. If OS X was based on Copland or even BeOS I'd still be running free UNIX on my desktop.
Prolog?
Seriously, name me a piece of commercial or open-source software with significant market share written in D. Library support is about 10000% more important than actual language design.
you should realize that spending an extra $100
I think you forgot a zero. Prices may be different in my-vs-your neck of the worlds, though.
and has much better software and hardware support than Linux.
I think Linux has much wider hardware support (it works on non-apple hardware too), whereas OS X has full support for a much smaller set of hardware. What's better depends on personal preferences.
I can run basically every Linux/Unix application on my Mac
Really? Didn't the summary just say that some of the system calls are missing on OS X and some macros are different? Or did you mean running the binaries (in which case, there's still the system calls)? Or do you cheat by running Linux on your Mac? ;-)
You love your Mac, and that's great for you (really, I mean that). But I think you might be overselling it just a little. Bullshit detector went from green to yellowish green ;-)
Not all Linux software runs on the macOS either.
Yeh, there's a lot of Linux programmers who wouldn't know how to write portable code if the portable code fairy shat clue down their throats. Last decade it was SunOS programmers, the decade before that it was people who thought all the world was a VAX. The world is full of people like that.
For techies, there is no substitute for Linux or FreeBSD. (I prefer Linux, but I have friends who prefer FreeBSD.)
Ask your friends about porting Linux code from people who think portable means "it compiles on Red Hat and Suse... ship it!"
Oh, while we're on the subject, you do know that Jordan Hubbard works at Apple now, don't you?
Sadly macports and fink are pretty poor :( They don't have enough people and most of the packages are broken or out of date. I have simple patches for projects which I run which have been sitting in the macports tracker for more than six months and still have not been approved.
Debian/Ubuntu/etc. still have by far the best package repository and that's enough to make my mac almost useless and my linux laptop the place where I do most of my work. Plus OS X is rather slow, argh.
lets see a Mac do this:
ssh -X hostaddr application
And have the GUI application pop up on a remote screen without the WHOLE screen like VNC.
You can't seriously be suggesting that X11 is unavailable for OSX. If you have an X11 application that you would like to run, you can certainly do what you're suggesting. No serious UNIX weenie should have any trouble building it. Your only possible room for complaint here is 1) that that not every application is an X11 application (something for which most users are thankful) or 2) that you want your mommy to have compiled the app for you already.
The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...
Now that's the truth!
I was at Berkeley when 4.2BSD was being pulled together, and did some work for the 4.1C release. I was one of the guys who got 386BSD to compile clean in the first place. I had a NeXTstation on my desk for several years. I was the FreeBSD handbook guy for a while. I worked with Tru64 back when it was the only fully 64-bit UNIX. I know what "BSD" and "Mach" are, better than you and better than most of the people who contributed to that Wikipedia page.
you should be aware that this is Slashdot
Yeh, I'm keeping that in mind. Thats why I'm not going to even TRY and explain just how badly you're misreading that Wikipedia page.
I really like D, and would give up C++ for it, but the one thing I feel is really missing is bindings for Qt. :(
Bunch of kids with a trademark in their pocket.
UNIX is a family of operating systems with a native API and system call interface based on the UNIX programmer's manual, published by Bell Labs (usually the 7th edition).
That's a *useful* definition for UNIX.
but Mac hardware is crap
Have you ever used mac Hardware? Their laptops have been amazing for ever. Apple has long been a major innovator on the laptop front. And many of the things you expect in a laptop were made a standard feature first on the Mac. Things like target mode, gig ethernet, auto-crossover, built-in wifi, built-in bluetooth, Ac adapter standardization, integrated mic, integrated camera, external battery indicator, backlit keys (or any way to view the keys in the dark), DVD burners, and there are probably more that I just can't think of. Macs have great hardware.
Yes, they may not have every possible feature, but they have lots of good ones and really versatile. Computer snobs who turn up their noses at macs remind me of car snobs, except that a lot of the cars those people like aren't that useful, and break down a lot. I don't get that mentality and I probably never will.
Right... because apart from Linux, all Unices are exactly the same
That's why writing portable code requires experience.
Linux is a fragmented mess of incompatibility
Good thing I still have this in my paste buffer:
If I thought Linux was "a fragmented mess of incompatibility" I wouldn't have been surprised that it required conditional compilation. As someone else noted, the conditional compilation was because it had been ported to Windows as well, not because it had to include distro-specific code.
He actually said that academics in a computer science department use it. Don't you think that they count as developers? His anecdote isn't that uncommon, on the academic research projects that I've worked on Macs are used much more heavily than other systems. My current project may be a bit extreme but more than 90% of the participants use a mac. They are all developers - across a wide range from people who are optimising low-level assembly routines, people developing in C, through to some higher level domain specific languages.
My own work patterns haven't changed that much since I moved from a linux box. iTerm has a full-screen mode, and I've always written code in vi. There's a decent version of gcc, and the other languages that I need like python, perl, prolog and others are all available and quite stable.
I find it quite amusing that most people in this discussion are either mac-heads bashing linux users, or linux-users bashing mac heads. It is a refreshing change to find that windows doesn't even make the minimum grade for people to bother attacking it. I just like the combination of stable hardware support (especially given that I use a laptop and power-saving and hibernation are vital) with a unix interface. Maybe I missed the compulsory religious indoctrination session, so I probably don't count as a "proper" mac fan...
Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
And what would that "good reason" be?
Because of the experience and features that their applications provide. What they do not know, and cannot be expected to know, is that these things stem from deliberate tradeoffs made by the developers of the underlying frameworks.
As any programmer worth his salt knows, any design decision comes with a set of tradeoffs. This is an inescapable fact, and only goes unrecognized by the ignorant (whether their ignorance be innocent or willful.) The fine art of balancing a set of tradeoffs is very difficult, and an inherent aspect of it is that you can't please everybody 100% of the time.
In this case, you are one of the unfortunate few that Apple deliberately chose to devalue in their design priorities, since one of the items high on your wish-list is ubiquitous remote displayability via the X11 protocol.
But, bringing our minds back to the subject of tradeoffs, what did they win by giving you the finger? (*) This is an easy exercise for those skilled in software architecture. The first thing that one needs to ask is what sort of restrictions does conformance to X11 bring with it? X11 is a set of abstractions that end up leaking into many different layers of your software stack. While I love X11, a lot of those abstractions were invented a very long time ago before anyone thought they might like different abstractions, like a hardware-accellerated Quartz display server - or CoreImage, CoreVideo, CoreAnimation.
This choice has given them the freedom they need to make architectural advancements faster, and now they're in a leadership position. If you are a programmer and you still think they could have delivered their current product in the same timeframe after having volunteered to be hamstrung by obedience to X11, then you might want to consider a career change.
Nothing comes without a cost. There is a long history of UNIX vendors who tried for years to bring a good GUI environment to X11 and the best they could come up with was CDE. (WTF.)
(*) one footnote here: it wasn't Apple that gave you the finger. This decision was made in the late 80s at NeXT when they opted against X11 so that they could get the WYSIWYG properties afforded by the Display Postscript system. After Apple acquired them, they kept the imaging model but replaced the Postscript interpreter with Display PDF. (PDF is, more or less, the PostScript imaging model without the full force of the Postscript programming language.)
The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...
Programming in D is nice, but the situation is a bit annoying.
1. Tango vs Phobos. Phobos is the official standard library, but it seems most use Tango. Phobos is also pretty low level compared to Tango.
2. The reference compiler dmd is 32bit only, gdc is outdated and abandoned, and ldc is still alpha status and has missing features. Ldc is quite promising though.
3. D2 is maybe the biggest issue. It has very useful features, such as partial C++ compatibility, but D2 is a moving target and practically no library supports it. It's also unknown when or if ever D2 will become stable. I haven't seen much discussion about it in the newsgroup either.
Although bringing Digital Mars C++ to the Mac and Linux would offer several advantages (such as very fast compilation times) there probably wouldn't be enough customers to justify the expense.
Abandoning X11 was a mistake.
"Abandoning" implies that they used to use it and stopped. NeXTStEP never used X11 as its underlying window system (its window system was Display Postscript-based), and Mac OS X never did, either.
Whether it was a mistake or not depends on your goals. It was a mistake if being able to run individual GUI applications "over the wire" is important. It wasn't a mistake if it allowed them to get a given level of graphics performance and capabilities faster.
does anyone else remember this already being on mac? I specifically remember downloading a D compiler plugin for XCode. It had a package and everything. I just never did anything with it. Also, it is what many Doshin shooters are written in. Epecially the ones written with BulletML. Many of these are crossplatform http://www.asahi-net.or.jp/~cs8k-cyu/
It is certain your iTunes application will not run in this way.
Have you tried tunneling Amarok in the way you suggest ? Unfortunatly for you, sound isn't part of the X11 specification, so unless you're using something like a sound daemon (a la esound) and have forwarded that also, the result might not be what you're expecting. I don't see why not being able to remotely display iTunes' GUI would be a problem.
"Not to mention all the idiots who use words like boxen."
Anonymous Coward on Monday August 04, @06:49PM
Let's be clear. The limited capability here is the fact that you have to use a kludge like VNC or Apple Remote Desktop to access your computer remotely. Apple (and Microsoft) have ditched this "important feature" in favour of improving the UI experience for the user when they are sitting in front of the computer. And guess what, only a few people ever complain about the lack of this "important feature", the reason being that most of us do not lock our computers in server rooms and access them with X terminals.
It's clear that Apple (and Microsoft) have made the right decision because more than 99% of personal computers run one or other of those operating systems. Your "important feature" seems to be totally irrelevant to 99 and a bit percent of all computer users.
All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
Depends what you like... Perl's a favourite of mine, probably because of the things you hate about it. It has a very natural feel to it, as the way which it's evolved, like natural spoken languages, there's all kinds of often hidden subtleties, and there's nearly always more than one way to do anything, different ways efficient in different ways and so good for different purposes. Downside of course is it's multithreading support (or rather, lack of it).
I like it for server stuff, as it's real easy to get it to detect when the code on disk has changed, load 'n compile it into memory, and splice it into what's already running... without losing any data structures or anything, and if there's any errors in the code, throw an error, and go back to the previous working version of that module. Without need for any close/restarts.
The revolution will not be televised... but it will have a page on Wikipedia