Thursday 31 July 2014

Operators

Before handling virtual functions, I fixed up operators. You can now export operators, you can access operator members and use them as expressions, you can access operators statically, etc. You can also have dynamic operators when before they were banned.

I need to switch to Ubuntu to try and figure out why 209 tests suddenly failed on TeamCity, though.

So up next I promise: virtual functions. I already added support for final classes.

I also removed "auto" as a feature. Previously when doing type-inferred arguments, you could use "auto" as the decayed argument, so you could do e.g. "f(arg := auto.lvalue)" that would only accept lvalues. I removed this feature because it's redundant in the face of concepts and complicated the implementation for little benefit.

I'm also hunting to reduce ABI dependence. The MinGW x64 ABI is quite similar to Itanium but the EH is different. This obviously isn't a big deal for me, pretty much all the work is done on the LLVM side and not the Wide side. But in general, I have a bunch of stuff which is full of Itanium-specific details, like layout, vtables, RTTI and such.

Also turns out that I totally mis-implemented Itanium ABI for function calling, so parameters you pass by value to C++ functions will be incorrectly not destroyed, and there are other destructor bugs w.r.t. this misinterpretation that I wish to fix. It also makes my life easier w.r.t. elision in many ways. I'm a big fan of this and this fix because it only removed complexity from the compiler.

Wednesday 30 July 2014

Virtual Functions

Virtual functions are up next. I'm talking about final, override, abstract. Also clean up the internals to be less Itanium-ABI specific, and some general clean-uppery going on. After that, I will probably look at constants. I have an idea for how to handle them infinitely better than C++ but we will see what LLVM can support in this regard. And maybe include dynamic inheritance (virtual inheritance).

I've also been thinking about including & and | as type composers. | is more of a Concepts feature, but & I've been thinking can be useful for regular inheritance. This would effectively compose base classes to produce a new type, where any class that derives from both base classes is considered as deriving from this new type. The implementation I would think as being not too unlike dynamic inheritance, except that dynamic inheritance is intrusive and this feature would not be.

Monday 28 July 2014

Personal details

So far, I've been pretty allergic to having my personal details be Googleable. I get too much random crap already. Hey, puppy, come work for us in Amsterdam, £45,000 a year doing ASP.NET. Send CV if interested and don't forget to ask your friends. Yeah, right. So you don't know anything about me, who my friends are, you want me to do your job for you, and could I please come work for you? Kindly go shove it.

But I guess that I'm just going to have to learn to ignore them instead of shouting at my monitor in rage. For now I really want a job. Not that kind of, I'd like a job but I'm not sure how sick I am or am not and I didn't commit enough to any particular project to have anything to show for it. I really want a job, I'm healthy enough to do it, and I've got something to hit people with- a project I'm doing that's complete enough to clearly show it's potential.

So I guess that it's time to stop hiding in my corner and start really selling myself and learning to either ignore or slap those super annoying spammers.

Friday 25 July 2014

Windows Phone

My old iPhone died. I bought a new Nokia Lumia 630 with Windows Phone 8.1.

Boy, this shit is incredibly fucking annoying.

You can't even add a local contact without it having to be synced with some bullshit cloud account that totally doesn't need any of this crap. And Microsoft neglects to mention that you can't erase your bullshit cloud account from the phone later on. And every contact has to be a Person. It's not a Person. It's a fucking phone. A landline. Shared between FOUR people. So kindly do me a favour and fuck off with your endless cloud bullshit Microsoft. Just put the name and number on a text file on the local storage. How fucking hard can that be?

Thursday 24 July 2014

More work on defaulted members, more bugfixes

Reworked the Clang object support layer to be more reliable (caused some bugs which are now fixed and simplified the compiler). I'm looking into simplifying a bunch of the compiler-generated functions stuff. For example, I know that their EH is already totally bugged. I need to simplify some other stuff too, like there's many places where I repeatedly get the function argument type analyzed. And I need to implement AnalyzeExpression in terms of AnalyzeCachedExpression if I can. And fix up statements to be Function-independent.

And the operator handling still feels like a hack. I need to introduce t.operator+ and operator+ as valid expressions and, I feel, generally unify the handling for identifiers and operators in a more useful fashion than my current hackitude.

I've also been thinking about introducing explicit operator overload set unioning, and explicit ADL requests.

Most importantly, I feel like I've defined my first milestone, Phase One. The objective of Phase One, most simply, is to reach something like feature parity in the compiler. This will probably involve some variant of concepts later, but for now I'm mostly looking at smaller features like default, delete, override, etc. Emitting some DWARF debug data would be great too.

Finally, I've been thinking about creating some functionality as pure extensions. I want to show that my compiler design really is modular and extensible. I might start with a basic feature like properties.

Sunday 20 July 2014

More docs, a minor feature, a bugfix

I mostly tweaked my website and added more content today. I also fixed a couple bugs and hopefully introduced defaulted constructors.

I've been kinda plotting modules. I've been thinking about what form I need generic functions to take. LLVM IR is too low to preserve Wide's semantics. But I'd rather skip having to have an AST or something. Maybe for the immediate future I'll just ship the source.

I feel totally grump. I feel like I don't make much of a dent in my giant list of things to do and my source code is a terrible mess. I've been thinking and my list of things that I need sums up as "Everything".

At least a diagnosis isn't on the list anymore, I guess.

Thursday 17 July 2014

Examples and tests

Producing more examples is really helping with the testing. I found two more bugs today, one of which is fixed. I added a couple new far-from-final tutorials. But as expected I spent most of the day running around. Hopefully tomorrow will involve more code, less running.

Monday 14 July 2014

Modules - concepts

I realized two important things today.
First, the linker is my enemy more than the compiler.
Second, modules depend on concepts, but they can do more than I had ever imagined. I am a Cylon and I have a Plan.

I have ordered a wireless adapter so that I may have reliable internets. After that I am going to make mentoring a shot. I have a webcam because apparently seeing my face is so essential. It would be super nice to supplement my income.

Currently, I am fixing up CLI. Not building all in my project has made things a bit mediocre w.r.t. forgetting to build all the stuff. I also figure that I can solve my test times problem by moving to x64, where the x64 release version of Wide should be just fine w.r.t. testing times (also invoking the operations asynchronously should help).

Saturday 12 July 2014

First-class website

I've decided that one of the primary reasons my website efforts have failed in the past is for two reasons.

One is that I always considered them as a separate project. They were an optional extra, not a core part. This is something I'm looking to change right now. I want to integrate my website build into my primary Wide solution so that everything Wide will be in one repo except the C# addon. It's notable to see the decay in that project too. But to begin with, I've officially added the website code to my LOC-count command, which now stands at nearly 21k.

Second is mostly that I simply didn't have an implementation functional enough to discuss or tutor anyone with. My current implementation is a lot more useful in that regard. It still has a long way to go in every aspect. I've discovered that writing the examples really helps me see what's missing- like when I wanted to demo the return type inference and got stuck up against boost::optional. It also produces more tests, which is greatly useful for me.

Trying to build examples on the Wide CLI has shown me that my error handling desperately needs attention right now. I'm trying to build a sample and "Fuck" is the whole error message. I had to grep the source for "throw std::runtime_error("Fuck")" (got way too many hits) but I'm pretty sure I figured out the problem. Boost.None is a member function pointer and as we all know, the current limitations of the implementation are that it cannot handle implicit conversions from types that are not a (reference to a) ClangType to a ClangType.

This means futzing around with one of the most problematic areas of the compiler- the IsA function. Ho boy.

Bugfixing

I've been fixing a whole bunch of bugs. It's amazing how many you can find when you need to write examples in the language. For example, if you have a C++ type which is not a struct/class, then it crashes the compiler. That one's still in but I managed to convert member function/data pointers to Wide types, so stuff like boost::optional works now (boost::none is a member function pointer). I fixed a bug where issuing an error would crash the compiler. I fixed a bug with lookup of exported functions. I fixed a bug where some integral conversions would crash the compiler. I fixed a bug where attempting to access a nonexistent macro would crash the compiler. I fixed a bug where using member function templates or constructor templates would crash the compiler. (starting to see a theme here...). I fixed a bug where a const (const char*)& would cause spurious OR failures.

I fixed a bug in my test harness that caused spurious test successes (mostly failed on Linux). I reported (and had fixed) a couple bugs in coliru so that when I update Wide, it updates more readily.

But one of the things that concerns me the most is testing times. Now that I have way more tests involving the C++ Standard Library, it's becoming very problematic to test on Windows. Instead of taking like 10-20 seconds to complete a run, it's now like 3-4 minutes. I can reduce this problem by running the tests in parallel, but it's still going to be a bitch as I add more testing. This, aside from anything else, may drive my primary development platform to Linux. I dislike Linux but boy, the tests run a lot faster there because you can link release Clang even with debug symbols. I would test in Release on Windows but LLVM and Clang don't seem to play well with hosting both x64 and x86 objects simultaneously and the x86 release premake is broken...

As you may expect, I've also been writing more content for my website and fixing it up. The navigation is, I feel, a lot nicer now, some of the content is better, and I've created more examples.

Monday 7 July 2014

More website stuff

I rigged up my website to now have a live Wide compilation service backed by Coliru. I also wrote a few reference pages. I still suck at website design but it's a lot better than before. Now I need to write oh so many more reference pages. It helps to have more to actually reference.

I'm more thinking about what direction I want to take the tutorial in, though. Right now since Wide has only a tiny Standard library of it's own and most library functions are imported from C++, I feel like it would be adequate to target it at people who already know C++. If you're not comfortable at least discussing C++ then you won't get far in Wide right now anyway. So I figure that the first order of the day is a quick tour of the C++ interoperation facilities.

Writing the reference makes me think more about what the semantics are, and having them written down is useful for me.

Friday 4 July 2014

Other stuff

I've implemented default destructors, other default/delete stuff will be more painful. Had my surgery on Tuesday, been slacking all week to let the holes in my gut heal. Apparently, I have to go back to sickness claim for these seven days, then go back to jobseeking claim afterwards. What a total waste of time and paperwork.

I've decided to take a brief break from Wide to work on my website. I've moved the hosting to Github pages but I need to create content for it. I need to spend more time properly advertising my work. In addition, the GitHub for Windows program seems pretty nice, I'm not quite as familiar with it as TortoiseHg, but it might be worth seeing what the Git integration is like for VS. Apparently it's easier to attract contributors on GitHub and Git seems far more popular than Hg, and having the VCS baked straight into the IDE seems good.

I've also purchased a webcam. I've heard of various video code mentoring/assistance/etc services that pay the helpers, so it's worth checking into whether or not there's money to be made there. Supplementing my meagre income would be nice, even if it's not enough to support me on its own.