OpenCL quasi-quoting - haskell

I'm looking for a way to use OpenCL nicely in Haskell, and found these slides (alternative source) by Benedict Gaster. They mention an impressive “HOpenCL Contextual API” but I can't find anything tangible.
The only thing coming close to the C quasiquotation shown seems to be language-c-quote and its OpenCL-C support ends with the types, it doesn't support the extra keywords.
And accelerate is something completely different, and mainly for CUDA, with the OpenCL backend in early alpha.
Then there's HIPERFIT where no code was posted for a year (but the project is still running), which seems to combine the C quasiquotation and OpenCL, their bindings are even called HOpenCL, but are just a wrapper, nothing to see of the monadic transforms etc.
None of this seems close to finished and ready to build upon…
Any news or other projects I missed?

I was looking for exactly the same thing, and I came across this: https://github.com/bgaster/hopencl
This must be what Benedict Gaster - who is not working for AMD anymore - was talking about. There is not a tremendous amount of activity on the git, but there was an update about 2 months ago, which is still better than a year.
EDIT: Actually J. Garret Morris (the other author of HOpenCL) created a fork: https://github.com/jgbm/hopencl

First seeing you post here now. I'm the author of the HIPERFIT-hopencl package and sort of also a bit responsible for the language-c-quote OpenCL C support. I apologize for the naming confusion and that we now have two hopencl-packages. I have mailed Benedict Gaster and J. Garret Morris about how we resolve that.
What do you find lacking in language-c-quote? Could you give an example of what OpenCL C code that it doesn't handle?
(PS. I'm new here and could not find a way to comment on your post, so I had to post this as an answer - perhaps I just haven't reached the right "clearing level" yet)

Related

Alloy and Alloy*

I have read the paper about Alloy* last week and it seemed very interesting to me and the fact of integrating higher-order quantifiers will help me with my work. But I want to know is it is still an on going project and if I could keep on working on there version of the Alloy Analyser UI and is it stable ?
The Alloy* project is currently not under active development. It is, however, stable, and other researchers are using it to carry out their own research.
You can get it (including sources) from http://alloy.mit.edu/alloy/hola/.
Feel free to contact me directly if you need further help with compiling/using it.
In the mean time ... Alloy (not Alloy*) is now an open source project on Github: https://github.com/AlloyTools We are discussing also including Alloy*

AutoCAD 2006 vs. 2012

I'm looking to learn AutoCAD. I have found several videos online that relate to 2006 AutoCAD - but is there a difference to any of of the versions. I have seen job postings asking to know AutoCAD 2008 -- what happens if I only know 2011 or even 2010. Can I work with 2008? Is there a difference to any of this versions or years?
AutoCAD is a lot like Windows... They have major releases and minor releases, so the change from 2006-2007 was a significant change. They roll out a major release every couple years or so. Still, it just depends on what you're doing. If you've got to draw a line, it's drawing a line, and that doesn't change a lot from one release to another. Some companies use the "features" of the software, but lots of them don't. My advice: get an account with Autodesk University here and click through the online classes. Look for some basic AutoCAD classes. It will really help you learn about the software and the changes made from one release to another. Also: If you get an interview for a CAD job, they will probably give you a test... usually it's just drawing something in CAD from a piece of paper. I had one of these where I had to use a version of AutoCAD called Architectural Desktop. I had never even seen Architectural Desktop before, so I asked the person interviewing me, "Where do I start?" He showed my how to start, and I actually got the job. That was 7 years ago and I still work for that company today. Use the free tutorials to acquaint yourself with the software, but don't be intimidated by it. If you get as far as testing in an interview, do your best, and don't be afraid to ask questions.
If I recall correctly 2006 was still a version without the ribbon interface. In any case, the most significant change in user interface in the recent years was exactly that - caused quite a bit of stir when it was first introduced, and many drafters still switch to "old" toolbar.
As far as changes go, yes, there are quite a few. But as Asheville said, they more relate to some advanced features of the software, which at this time you will probably not be using. My advice would be to start with some of the newer versions ("the ribbon" ones) and adjust yourself to it. After you've grasped the fundamentals, and found your way around, and wish to expand your knowledge in a more systematic way (although we all know this almost never works :) I would go to one of the either; "Autocad xxxx Bible", or "Mastering Autocad xxxx" books where xxxx signifies the version. They are quite heavy (figuratively and literally) and you can skim through as you progress. Most of the things in there you probably won't need, unless you find yourself working in a large draft office which has it's own way of organizing data, drawing styles, ...
Autocad forums are also a good place to ask questions (search first !) ... the community there is quite helpful.

Is SubSonic dying

I'm real interested in using SubSonic, I've downloaded it and I'm enjoying it so far, but looking at the activity on github and googlegroups it doesn't seem to be very active and looks a lot like a project that's dying. There's no videos about it on tekpub and Rob seems to be using nHibernate for all his projects these days. I don't want to focus on learning SubSonic and integrating it into my projects if it's not going to live much longer.
So my question is what's happening with subsonic development, is there a new release imminent is there lots going on behind the scenes or is it as inactive as it seems?
I get this question, it seems, if I don't pop a release every 2 months or so. I will admit I'm behind on getting 3.0.0.4 out the door - but there's some patched code that people are sending in without tests and I will not accept that - I'd rather take my time and make sure we don't push bugs (which I apparently did with 3.0.0.3).
Anyway - it's a valid question and no, SubSonic isn't "dying". The best place to see the activity is on the Github site itself:
http://github.com/subsonic/
This is one of the main reasons I chose Github, so people can see the activity. I just pulled in a number of changes and am waiting on a last one to get tweaked (there were merge conflicts).
RE your other points:
No, I'm not using NHibernate for my work. I'm using it for Kona and a screencast. I answer just about all the email I get from out group but yes, GoogleGroups is a sad thing when it comes to pruning the spam. Your best bet is to just email the group list for a question - it will get answered pretty quickly.
In terms of "death" - I need to talk about that a bit. Open Source projects are incapable of dying if they were born in a fit of inspiration and people find it useful. Both are true of SubSonic. Even if I gave up and told everyone to f-off, someone would pick it up and run with it. I do have to work, like most people, and I have to fit SubSonic into the little amounts of freetime I have between work and family. But there's no way I'd let this die - it means far too much to me.
Either way - I'm sure I'll be back here again in 6 months, answering this question again :).
I suspect since its that time of year people are on holiday/vacation so support here is reduced. I have just started using it and havent had responses to some questions and the last release was in July, so am hoping support continues.
I must state that although there isn't a new release every 2 months as Rob stated that you may get that feeling sometimes. Although there is still action on the google group and github. If anything before christmas there were more fresh faces starting to make contributions than before (even simple ones like doco) this shows me that there may be more interest than ever, its just that people are getting on with it.
My work uses Subsonic (both 2.2 and 3.0.0.3) in most projects where we have control over it. We have around 28 .net devs and they all love it (we don't get caught up in what it can't do as its not an ORM/data access say per se.
As we only use Subsonic for low level query tool and not as a data access layer i spose we're not too closely connected to it if we need to bail on it, but we are yet to have a reason too.
My point is this: Its a really really easy to use, easy to pick up, easy to modify, light weight querytool/ORM(to a lesser extent). There are few tools out there that have all these properties and yet don't lock you into a million schools of thought on things. Because of this i don't see it dieing any time soon - its too addictive a tool to have on your bat belt.
I'm an active record fan buoy and SubSonic Rocksorz My Sockorz!
Because of this i recommend SubSonic to a lot of people and will continue to. While we don't use it on extremely large projects (more for project continuity reasons like you mentioned than because it can't do the job)
Well.
I don't know how subsonic is progressing. I started use subsonic from 2007, before upgrade to subsonic3, I was pretty convenient with subnoic2. it is stable and predictable. But with subsonic3, even 3.0.0.3. It is somewhat disappointed for me. I don't want to mention the features that works. Thanks. Subsonic map table correctly. The thing I want to talk is about "Update". I tried with the code but it gave exception. After dig into the code, it is signing...
Look at my code:
FarmDB db = new FarmDB();
db.Update<UserAdornment>().Set(o => o.is_working == false)
.Where(o => o.user_name == HttpContext.Current.User.Identity.Name && o.type == userAdornment.type && o.id != userAdornment.id).Execute();
Is this correct?
After fixed the NullReferenceException some one asked which I suffered too. Each time I run this query, all my rows with user_name=currentname is set is_working to false. After checked code:
In update.cs
public Update<T> Where(Expression<Func<T, bool>> column)
{
LambdaExpression lamda = column;
Constraint c = lamda.ParseConstraint();
And check lamda.ParseConstraint();
I see, whatever how many 'where" I want to search, it only return the first one, the worse thing is after it,
//IColumn col = tbl.GetColumnByPropertyName(c.ColumnName);
//Constraint con = new Constraint(c.Condition, col.Name, col.QualifiedName, col.Name);
//con.ParameterName = col.PropertyName;
//con.ParameterValue = c.ParameterValue;
It built another constraint from previous one, but drop all the "condition" in last one.
How can it be right?
I don't look into subsonic's sourcecode too much and don't understand it how it is implemented well. But I am using subsonic3 in my project and highly depend on it to work correctly. Really hope every bug can be tested and fixed in time.

A guide to Boo's metaprogramming and extensibility features?

I'm interested in learning about Boo's more powerful features such as syntactic macros, parser support (Ometa?), compiler pipeline, etc. My impression is that these areas have been in flux and somewhat under-documented. Are there any good resources for learning about these things other than studying the source code?
ask code gardener / boo author #rodgrigobamboo!
"boo metaprogramming facilities I - the ast".
There's Building Domain Specific Languages in Boo. I got an early early access edition and found it frustrating for the "flux" reason you mentioned; I finally gave up. Hopefully things have stabilized since then.
Feel free to ask questions on the mailing list:
http://groups-beta.google.com/group/boolang?pli=1
By far the best reference to see what Boo can do is to spend a bunch of time going through the tests. It takes a while to puzzle out what's going on, but the tests really do flex all of the muscles that are available and are quite well written.
https://github.com/bamboo/boo/blob/master/tests/testcases/macros/macro-1.boo
Also, note that boo's interpretter- booish- is really excellent and if you're not sure how a test works, you should probably spend time in booish prodding at it.
http://boo.codehaus.org/Interactive+Interpreter
I haven't looked through this site extensively, but it appears it may have the best references for Boo:
http://boo.codehaus.org/Tutorials
This section is still not well documented but if you look at https://github.com/bamboo/boo/wiki/Syntactic-Macros you can see how to make syntactic macros. Basically you have to implement Boo.Lang.Compiler.IAstMacro.
The correct section is in https://github.com/bamboo/boo/wiki/Abstract-Syntax-Tree but it largely seems incomplete.

Why can't I keep 2 languages in my head at the same time? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
At home I'm working on a large personal project written in Java. I recently found employment as a C# developer.
After an 8 hour workday reading C# code, I find it very hard to switch back to Java at home. Actually, my home project stalled almost completely since I've been employed.
At first I thought I'd have to wait for vacation to actually switch back to Java, but even after a week of not having C# on the brain, I did not manage to come into Java-mood again. I do not want to admit that my home project died, but I can't really see a way to overcome this issue.
If it's that bad, can you start the project again in C#? It may be quicker than waiting for your java-mood to return. It should be quicker than starting from scratch, as you've coded the logic and domain already, so you may be able to translate-and-type your way through that bit.
Use a good (and comparable) IDE in both. I switch between C# and Java, and find the combination of Visual Studio with JetBrains ReSharper for C# and IntelliJ Idea for Java makes this straightforward.
Celebrate the differences - I find a spell in C# helps my Java and vice versa. Differences in, for example, the collection frameworks just help you understand the implementations in each language more deeply.
Use the similarities to your advantage. Syntactically, the differences are not great. You should be writing code, not writing C# or writing Java. As Steve McConnell would put it, "code into the language and not in the language" (or something like that - think it's from Code Complete).
In fact, read Code Complete if you haven't already - great training for flipping between languages.
I suppose you could call this the habitual time to recovery,.
It can help to generalize to: programming logic knowledge + syntax and API = Language Knowledge ... because ...
Human beings are creatures of habit and build efficient work methods, memories and psychology based on environments and tasks we perform most often. This is a good thing.
I recently spent alot of time programming in Python, after being almost 100% C for a long time. I picked up Python quite easily and now am switching back to C. To my surprise, the problems I thought I would encounter (missing semi-colons, the random impulse to indent) were not there.
I concluded this is because:
While I was programming Python, I was frequently (daily) looking at the C source of other projects to remember the ones I didn't document too well. Because my C projects fit in with the Python stuff.
I was always looking at the C implementation of some of the Python stuff
I guess the trick is to relate new skills to old skills so that when you conduct tasks in the new skillset, your brain is still thinking about the old skills and how they related. Many theorise that learning is based on this relational foundation in your mind, and knowing about it can help you reduce the learning curve and time to recovery.
Think of it like a relational database. When you do something new, create a forign key and normalize things out. Don't create a whole new table or database.
Learn a generalization of programming logic and build on that with just the changes between languages. You will learn/switch faster.
Sorry for the bad RDBMS analogy
Your brain is full.
Full Brain http://img146.imageshack.us/img146/2469/brainfull.gif
Firstly, if you've put in an 8 hour day programming in any language, it may not be switching languages so much as just needing a break from programming. I can only speak for myself, and I know some SO'ers may feel otherwise, but I often need a break from programming after a full work day of doing it.
Currently I prefer to program in Python, but my job wants me to do shell scripting, Java, JavaScript, PHP, and IDL (that's Interactive Data Language, not Interface Description Language). So, I try to do some Python at home to keep those skills from atrophying. What I find (in addition to often needing a break as mentioned above) is that I get my languages confused a lot when I first switch from one to another. It's easy at that point to give up, but I find that as I get mentally deeper into programming with a given language I make fewer mistakes from the language confusion. So, maybe if you can just push past that first reluctance to use Java, you'll have success. YMMV, of course, and good luck!
This is because of something in psychology called the interference effect, or Stroop Effect. The two tasks are closely related (programming) so the knowledge brought into your mind by one language interferes with the knowledge brought into your mind by the other language.
Here's a cute example of a simple task that is hard to do because of this effect:
http://www.apa.org/science/stroop.html
Switching between two different frameworks is very hard to do. It's even harder if you haven't been doing them for very long.
The question, I think, has to come back to you in that you should ask yourself what you prefer now. If you still like Java and want to keep your skills up in Java, you will probably need to spend more time with it on a semi-daily basis. Working with it on nights and weekends and making sure there are no long breaks in between.
If you prefer C# now and really have no interest in persuing Java, I would convert the project at home to C# as that can only make you a better C# programmer and make you better at your day job.
I wonder if it's related to the similarities between those particular languages. Granted I've not actually used C#, but it seems pretty similar to Java. The similarities might make it difficult to context switch from work to hobby. Maybe you could learn and switch to Python, Haskell, Lisp, etc. for your personal project.
You could try spending some time programming in a completely different language in your spare time. For example, write something in Haskell, Prolog, Mercury, Oz, or Factor.
When (if?) you come back to Java, its similarities to C# will be much more striking than its differences.
That is normal. It may be a problem of Cognitive Flexibility and Inflexibility. It happens with human speech too.
Check yourself. If you are getting too tired to work at home after your regular 8 hour workday reading C# code, and also you want so much to finish your project, and now you find difficult to code in java, you may be suffering from anxiety. If you take some energy drink, coffee, cola, then you are favoring anxiety.
There are exercises for keeping yourself Cognitive Flexible. One of them is to switch for a while (couple of minutes) to Java instead of spending so much time in C#. It is like when you are programming in Java and have to switch to SQL, then to HTML. You are being flexible and switching.
Good luck.
As I answer this i feel I need to make some assumptions here based on personal experience. I write code in C++ or c# on side projects while at work am forced to dangle between php and python
There was a time i was without a steady day job and kept pretty busy on side projects.
When i landed my day job the enthusiasm i had for my side projects dwindled based on two major factors... Like you i was at my job 8 to 9 hrs a day.
2ndly i had an increased steady source of additional revenue so the motivation to code just to earn a living drastically reduced and i found myself more and more opting not to take up any new projects after work coz i jus wasnt in the mood anymore.
I also discovered that with this new attitude i started making rookie mistakes when coding in c++ unlike before. After changing my attitude things picked up again.
My best guess is that you are going through the same thing that i was going through. I suggest you find new ways to get motivated once you leave work and you will find it easier to continue programming in java.
I have a similar thing at work. I write code in JavaScript and c# but at home I write code in Python and JavaScript.
I have sometimes caught myself writing python style code in c# and then getting my tests failing. I agree with Nat that working in a language that is totally different from your work language will help you see the similarities and that they only differences will be where the libraries exist!
You know when you are overworked: it's when you try to find F1 key in the elevator cabin to launch it up!
I think java is for the diligent, and .net is for the lazy.
Perhaps someone would be angry for that,but I wanna say I am a .Neter.The .net syntax is less strict than the java's.In fact in the source code of .net,there is some simplify.
for example,we can use Convert.toDateTime(string) to Convert a String to DateTime directly.
But in java,we should make the difinition of the string's format such as "yyyy-dd-mm" then we can convert.

Resources