Age of Enlightenment: The Promise of Circadian Lighting - <AUTHOR> https://undark.org/article/circadian-lighting-human-centric-lighting/ <comment><USER2> Since these kind of stories are pretty popular on HN I maintain a list at [https://github.com/Jimnotgym/Hacking_Depression](https://github.com/Jimnotgym/Hacking_Depression)

Maybe it will help someone.

For anyone who thinks this is medically reckless, please see the earlier discussions where it has already been discussed to death.

</comment><comment><USER3> I have a bank of blue LEDs that shines on my white ceiling in the living room. I live at a northern latitude so the big interest was in avoiding the blahs in the dead of winter.

I initially had them on for 12 hours a day centred on solar noon. That produced a feeling I associated with spending the day out in the sun which I did not find pleasant. After some messing around I now have them turn on for 12 minutes every 2 hours during the day. The first blue light interval is an exception, it is 24 minutes. Having 12 minutes for "daybreak" just didn't seem to be enough.

The only objective result I can report is that I no longer find myself opening the blinds on the living room window. Before the blue light system I used to open them daily. So ironically I now spend most of my day in semidarkness.

I leave them running in the summer when the problem is an excess of light. It doesn't seem to make a difference and it means that I no longer notice when the bue light is on or off.

</comment><comment><USER4> Is anyone else unaffected by lighting and screens?

Ive been 'addicted' to the computer/tv since I was 1 years old apparently.

I dont find myself affected by any of these blue or yellow lights. I tried making the change and thought it was easier on my eyes, but I didnt feel different.

<comment><USER5> My hypothesis is that the people who get majorly affected by blue light at night, are that way because they're not getting a strong-enough pulse of blue light _in the morning_ for their circadian clock to calibrate itself by. It latches onto whatever signal it can find, and thus begins to think that "sunrise" happens at 9AM when you sit down at your blue-light-emitting monitor, rather than at 6AM when blue light starts coming down from the sky.

Or, shorter: maybe it's because you have large east-facing exposure in your house.

<comment><USER6> Do you mean West facing? If you had a large East facing exposure then it would give you that pulse of blue light in the morning. I've got a big East facing exposure and don't have any issue with blue light screens. Watch TV every night before bed. No problems.

<comment><USER7> That depends on which hemisphere you're in.

<comment><USER8> Unless you're on another planet, no.

</comment></comment></comment></comment></comment><comment><USER9> I've installed this lighting through the ground floor of my house. It's not continuously variable but has three different white point LED strip lighting systems that are transitioned from one to the other based on the color temperature reading from outside.

<comment><USER10> Where can I buy such systems?

<comment><USER9> I built the high level system but out of stock components from the usual suspects. I used off the shelf components though. Standard High CRI LED strips, stock power supplies, 0-10v dimmers, and a Raspberry Pi in charge. Most of the hardware and heat sink from superbrightleds.

<comment><USER11> LED dimmers introduce another problem in some people, which is the high frequency strobing, which can cause headaches and eyestrain.

<comment><USER12> A good LED dimmer won't do this. There's even a standard now: IEEE 1789. It's possible, albeit hard, to find IEEE 1789-compliant dimmers.

<comment><USER13> I was about to back to Halogen Lamp, and I was hoping there are improvement to Halogen Lamp then anything else.

Are there any Consumer LED Products, that offer High CRI 95+, may be with less UV since that should be less indoor, Long Life, Little degradation on CRI and Lighting over time, and more importantly NO / Zero flicking?

I have been asking and thinking, assuming all our electricity is green and cheap, why would I want a LED over Halogen Lamp? All the problem I have, which I absolutely hate and drive me crazy are colour inaccuracy and flickering. Both of which are non existent to Halogen Lamp.

<comment><USER12> > All the problem I have, which I absolutely hate and drive me crazy are > colour inaccuracy and flickering. Both of which are non existent to Halogen > Lamp.

Not really true. The fancier halogen lamps (e.g. MR16s with reflectors that pass IR) have CRI below 100. Halogen lamps _do_ buzz, especially when connected to a dimmer. (Many halogen lamps are 12V, too, and most of the transformers also buzz.) And they _all_ flicker — the power delivered to the filament is roughly sinusoidal at 120Hz, and the thermal mass is low enough that there is a good amount of modulation in the light output. IIRC it's about 30%. It just so happens that the residual 120Hz modulation is low enough that it doesn't affect most people.

A crappy LED driver modulates much deeper than 30% at 120Hz and might even modulate at 60Hz. A good LED driver doesn't.

</comment></comment></comment></comment></comment></comment></comment><comment><USER14> All the site looks like an ad. It is interesting, but does not take in consideration factors like the damage that blue light can cause to children's eyes: [https://vu.ca/en/journal/blue-light-a-danger-to-your- childre...](https://vu.ca/en/journal/blue-light-a-danger-to-your-children-s- eyes/)

<comment><USER15> The sun puts out enormous amounts of blue light. Yet actual research[1] shows that children with more exposure to UV-B (obviously highly correlated with sunlight exposure) are _less likely_ to suffer from myopia. This site just says 'blue light is bad for you' and presents no scientific research. And is literally selling blue light blocking lenses.

[1] [https://jamanetwork.com/journals/jamaophthalmology/fullartic...](https://jamanetwork.com/journals/jamaophthalmology/fullarticle/2588252)

<comment><USER16> Lots of sunlight = outside a lot = lots of far objects to focus on

Staring at a screen all the time = eye constantly focused close

It doesn't seem like rocket science to me. Blue light seems like a very odd explanation, unless you're selling something...</comment></comment></comment>


AVIF has landed - <AUTHOR> https://jakearchibald.com/2020/avif-has-landed/ <comment><USER2> An interesting aspect of the AVIF technology is how well it degrades. In fact, lossy AVIF can even beat optimized SVG+Brotli in transmission size, with a comparable visual quality.

One note, however, is that encoding is notably expensive, as noted here[1].

[1]: [https://mobile.twitter.com/rem/status/1303396688049078276](https://mobile.twitter.com/rem/status/1303396688049078276)</comment>


Show HN: iPhone/iPod App to Find Domains - <AUTHOR> http://domaingroovy.com/domainfinder/

<comment><USER2> 2.99 doesn't hit my sweet-spot. And I realised that the price has stopped me from investigating the app further, to see what premium features it may offer.

<comment><AUTHOR> What would be your sweet spot for an app like this?

<comment><USER2> The sweet-spot to get me to check the app specs would be 0.59. Having now watched the video, I'd assume that you would get a referral fee from GoDaddy, at which point I'd want the app for 0.00.

<comment><USER3> agree. It's better to build goodwill and retain me as a customer with the $0 app and you collect the referral fee, than to skim off both ends.

<comment><AUTHOR> Thanks for the feedback guys. I've thought a lot about this and have some experience building domain tools. The truth is nobody ever purchases domains through the app.

You need massive volume (like advertising) to make this model work--it's just not there.

Making the app paid lets me keep the service running for the few people who think it's valuable enough to pay for.

This is a better solution I think than shutting down the service all together.

I'm definitely considering an ad-supported or free version, but wanted to start with a paid version first.

</comment></comment></comment></comment></comment><comment><AUTHOR> This is my first mobile app so I'd love some feedback.

<comment><USER4> Nice presentation on your website. How are you checking name availability? Registrars have purchased domains queried for in the past that weren't immediately purchased by the querier. You may wish to query the TLD registries directly to prevent that sort of behavior.

<comment><AUTHOR> Yea that's currently what we do, we don't go through any specific registrar right now.

I may need to adjust this in the future, so that's something good to keep in mind, thanks.

<comment><USER5> You should highlight this fact in your marketing. I'm buying the app now primarily for this feature.

<comment><USER2> Really?

</comment></comment></comment></comment></comment><comment><USER6> the autoplayed presentation is awesome</comment>


Microsoft To Cut Workforce By 18,000 This Year, 'Moving Now' To Cut First 13,000 - <AUTHOR> http://techcrunch.com/2014/07/17/microsoft-to-cut-workforce-by-18000-this-year-moving-now-to-cut-first-13000/

<comment><USER2> For those that follow Microsoft and Nokia: does this effectively mean that the acquisition has been a failure? Or was this the plan all along?

</comment><comment><USER3> Firing mostly Nokia employees. A buy to gut operation.

Gordon Gecko would be proud!

</comment><comment><USER4> Low cost is key. MS wants the Chinese, African, and Indian markets as they ride the wave to income parity.

</comment><comment><USER5> They are killing the Nokia X Android line too[1], just as I predicted in a comment[2] about that line being insurance by Nokia against the deal falling apart in the story about them releasing Android phones[3]. The comments are interesting in retrospect.

From [1] [http://www.theverge.com/2014/7/17/5911909/microsoft-kills- of...](http://www.theverge.com/2014/7/17/5911909/microsoft-kills-off-its- nokia-android-phones)

>"In addition to the portfolio already planned, we plan to deliver additional lower-cost Lumia devices by shifting select future Nokia X designs and products to Windows Phone devices," says Elop. "We expect to make this shift immediately while continuing to sell and support existing Nokia X products."

[2] [https://news.ycombinator.com/item?id=7937173](https://news.ycombinator.com/item?id=7937173)

[3] [https://news.ycombinator.com/item?id=7936919](https://news.ycombinator.com/item?id=7936919)

</comment><comment><USER6> Once again, Hacker News is tomorrow's newspaper today.

</comment><comment><USER7> liked this window.htmlAdWH('348-14-15-135e', "300", "115", 'f', 'adsDiva81062e1ef'); }); }(this,this.jQuery)); } /* */</comment>


Show HN: I've created a place for stories about failed start-ups - <AUTHOR> http://andaga.in

<comment><USER2> There seems to be some encoding issues. Ex. I didn't study my competition.

Very interesting concept.</comment>


There Is Never a 'Free Market' in Health Care - <AUTHOR> https://www.forbes.com/sites/chrisladd/2017/03/07/there-is-never-a-free-market-in-health-care/#1985187e1147 <comment><USER2> I find the logic presented in this article to be ridiculous.

If markets for healthcare can't exist, why is medical tourism a thing?

But enough about that, let's proceed.

Yes, if you just got hit by a bus you have no ability to comparison shop for ambulance services, but you also have no ability to do literally anything.

Outside of the comparatively rare emergency situation where somebody is bleeding out and going to die literally right there without treatment, there's always an opportunity to reasonably comparison shop for medical services even if you're sick.

I don't believe that the insurance system advocated in this article is a panacea. Because of the crazy insurance system that exists, simply getting the actual prices of procedures is nearly impossible. It's easy to comparison shop for a phone or a toaster because stores advertise prices. But it's difficult for even trained professionals to figure out the ballpark prices even for the most common procedures because of the crazy insurance system.

There are many articles like this where people call healthcare providers and try and determine pricing of even common procedures like child birth and get the complete runaround.

[https://well.blogs.nytimes.com/2013/07/08/what-does-birth- co...](https://well.blogs.nytimes.com/2013/07/08/what-does-birth-cost-hard-to- tell/)</comment>


Catastrophic Bug Found in Windows 7 RTM Build, Launch May be Delayed - <AUTHOR> http://www.dailytech.com/Catastrophic+Bug+Found+in+Windows+7+RTM+Build+Launch+May+be+Delayed/article15901.htm

<comment><USER2> Wasn't this found to be intentional? <http://blogs.zdnet.com/Bott/?p=1235>

<comment><USER3> Read the article you linked carefully... No where in it does it say that this behavior is intended or by design.

Bott (an admitted MS lackey), explains why in his opinion it won't stop RTM from shipping, or even delay it in the slightest.... and I fully agree.

The bug simply isn't priority 0. No one has Windows Update disabled these days, and this issue, as Bott well describes, won't manifest itself in _any_ of the _default_ configurations/options.

He admits it's incorrect behavior, but works out the logic why it's not the end of the world and correctly explains that the sky is NOT falling on Windows 7, contrary to popular belief :)

<comment><USER4> What?

Here's what I read, from someone who works at Microsoft:

 _[T]he design was to use more memory on purpose to speed things up, but never unbounded — we requset [sic] the available memory and operate within that leaving at least 50M of physical memory._

This is what happens, right? So I don't see how the article is wrong. I also don't see how this is a problem for anyone.

"When recovering your disk from catastrophic failure, Windows uses extra memory to make the recovery go as quickly as possible." OH NOES!!!11!!

<comment><USER3> Right. But two lines later, MS is now testing for the reproduction of the "bug"

<comment><USER5> No, they're testing for reproduction of the bluescreen crash that someone attributed (without a dump, or even a screenshot) to the memory usage of chkdsk.

</comment></comment></comment></comment></comment><comment><USER6> Why is this so catastrophic? How hard is it to fix a memory leak? Unless there is something else going on. But a regular memory leak?

</comment><comment><USER4> Awesome picture.

</comment><comment><USER7> It's not like in linux where you have to install all the updates yourself by hand!

Windows Update baby!

<comment><USER8> Yeah. That's really an issue unless you're using an OS that has malware/virus ratio below 200 per day.

In that case it's really a _must_ to have automatic updates.</comment></comment>


Design Mistakes We Made in Our iPhone App - <AUTHOR> http://sixrevisions.com/mobile/design-mistakes-iphone-app/

<comment><USER2> Great article, thanks for posting. I find the 'Mistakes we made with X' posts to be the most useful thing I read on HN.

</comment><comment><USER3> I particularly liked the approach they took with the "first run" experience, or rather the second approach after they learnt their mistakes.

I can't count the number of times I've downloaded an app and have been smacked in the face with the exact same screen of two text boxes (username, password) and two buttons (log in, sign up).

</comment><comment><USER4> I instantly forwarded this link to our lead designer for the insights like "Recognizing that no design is sacred". Really reinforces the idea that reiteration based on actual user feedback is important. We're about to launch an app so this was helpful! Thanks

</comment><comment><USER5> Most iPhone apps UIs are a mess because they include multitudes of interactions (tap to open a panel, slide up to open a panel, slide to the side to open a menu), and layers upon layers of panels without an easy to navigate back and forth. It's hell.

One UI that solved navigation in a satisfactory way is Windows Phone. Sliding sideways to navigate back and forth, and expanding details in place on tap _just makes sense_.

<comment><USER6> Not sure what your point is, since the mode of interaction wasn't the problem with this app. Trying to start a WinMo vs iOS war, perhaps?

</comment></comment><comment><USER6> > _We neglected to consider the importance of other categories of tasks, such > as [viewing, updating]

These kinds of tasks were actually more common than creation — especially on mobile..._

Sounds like a business analysis problem, then. Don't build for what you think your users will do or what they tell you they'll do, build for what they _actually_ do.

I'm not sure this was a "design" problem per se.

<comment><USER7> What a user will do at their computer will often be different than what they do on a mobile application for the same application. It can be hard to predict even if you do ask your users what they _think_ they would use on a mobile application.

<comment><USER6> Maybe, but a massive change in interaction in this case seems like an odd logical leap to me.

You have a website that does a specific thing. You, presumably, have analytics that show what users do on that site. In the case of Freshbooks you'd come up with some kind of ratio about invoices -- say, for every 1 invoice created, 10 are viewed (that seems probably like it's close to the truth, if anything the ratio of views would be higher).

To then turn around and make _creation_ of invoices the main interaction point on the app, despite everything you know about your site's visitors, seems like a logical misstep.

I hope I don't come off needlessly critical. My point is that you should have data to support changing interaction paradigms.

Another thought is maybe the Freshbooks folks thought the app would be an avenue for customer acquisition, in which case creating an invoice would certainly be the first thing they do (because new customers have no old invoices to view).

</comment></comment></comment><comment><USER8> Very insightful. Each point seems obvious after the fact, but it's good to get some validation on this 'obviousness'.

How do you handle the reports after login? Is it just a webview presenting the same content as the web app? I assume it's not too js heavy, so you don't run into performance issues?

<comment><USER9> Avrum from FreshBooks here (one of the authors of the post).

After login, the 'Create Account' and 'Login' buttons are replaced with two links: 'Email me a link to Reports' and 'View Reports in Safari'.

The primary call-to-action is the email because we recognize that the viewing experience for a traditional accounting report is still best on a computer (we actually say that in the copy). That said, if you need access immediately we provide it in a webview that shows the same content as the webapp (as you guessed).

Performance is fine on these pages but ultimately not as good native.

<comment><USER8> I like the thinking with the emailed link. So you basically have three buttons, one for email, one for view in safari, one for the webview? wouldn't it be more direct to show the webview immediately and give the other two options through some contextual menu?

</comment></comment></comment><comment><USER10> Nice writeup, I'm a fan of FreshBooks on the web. You guys should add better keywords for your app so your customers can find you:

vat,gst,bill,receipt,budget,report,finance,income,customer,profit,business,money,crm,ocr,pdf,bookkeeping,estimate

I'd generated these keyword suggestions with a tool we'd built for my startup at <https://appstorerankings.net>

<comment><USER11> As good as your tool may be, HN generally frowns on linkspam and SEO "hacking", and you happen to have placed yourself in the worst possible intersection of both.

<comment><USER10> I think you have misunderstood, as the post is specifically app store oriented. Still, I'm sure the app's authors would be delighted to see this post in an email form in their inbox.</comment></comment></comment>


Why big companies can't change - <AUTHOR> http://www.cringely.com/2011/12/why-big-companies-cant-change/

<comment><AUTHOR> The author, Cringely, mentions that he helped write the business plan for Illustrator, Adobe Systems' first consumer product. But you never get to see the business plans of super successful products -- that's what I'd like to see.

The one exception is "The Autodesk File" by Autodesk founder John Walker:

<http://www.fourmilab.ch/autofile/www/autoframe.html>

It has the genuine documents from Autodesk's early years including business plans, finances, stock discussions, etc. I'm actually amazed that he did release it.</comment>


Ask HN: Why the Affiliate Link Hatred? - <AUTHOR>

When a project containing affiliate links is featured here, invariably there are comments scorning the OP for being "unethical". While I see the ethical concern for journalistic publications like, say, the Atlantic, I'm not sure I see a problem with them being used to bring money to someone's blog or side project. What are the community's thoughts on this? <comment><USER2> It's only unethical if you alter your honest opinion about a product in order to promote its affiliate link. But otherwise if there's full disclosure and there's nothing deceptive about the link, then there's nothing wrong with affiliate links.

To some extent, its only natural to be a bit cautious about affiliate links because some shady "internet marketers" have used affiliate links in dishonest ways in the past - hiding the fact that they were affiliate links and not disclosing the fact that there is a paid relationship that could affect somebody's opinion.

But that doesn't imply that all or even most affiliate links are bad. On the contrary, I think more bloggers should ditch all kinds of crazy ads that track you across the internet and switch to simple affiliate links. If you run a blog about surfing or photography or whatever, you already know what types of products your readers are going to be interested in and can make money by providing quality product recommendations. Affiliate links seem like a natural fit to a lot of smaller, niche blogs as it really rewards the effort spent in creating high quality content because people will trust your recommendations more.

</comment><comment><USER3> Tech nerds have a pathological/ideological aversion to making money. I can't count how many interviews I've read/watched in which some startup founder congratulates himself for not worrying about how to build a profitable business (all the while accepting VC funding). This is why we get so many startups that crash-and-burn or acqui-hired (and then shuttered).

Affiliate marketing is an incredibly powerful tool that is under-utilized by small businesses/startups. But affiliate marketing serves no purpose other than to sell stuff and make money; It is nakedly sales driven, hence the animus towards affiliate links. Nobody should "want" to make money on the Internet, right? It should happen by accident.

</comment><comment><USER4> Jealousy, slippery slope, somehow putting a bias on the person collecting money. In some cases, in other places, the fact that people claim to donate the money to charity seems to dampen the negatives which doesn't make much sense.

I personally don't have an issue with it and I find it annoying when people (on blogs for example) point out that a link _isn't_ an affiliate link in a "I'm to good for this" fashion. As if money isn't important or they are above it all.

Irony is of course that a large part of HN is being a shill [1] for YC.

[1] I don't have a problem with that either even though the use of the word shill might indicate that.

<comment><USER2> I'm not sure why, but I agree that there is sometimes a bit of a weird bias on HN against making money online - which is odd for a community of people who are ostensibly devoting a good deal of their attention to making side-projects that make money.

What bothers me the most about this is the people that brag about using ad blockers to block ads and then use the same types of crappy ads to monetize their own sites. That's sort of an aside though, and doesn't apply to everybody. It's just a bit of a weird bit of hypocrisy that I've seen in some folks that is modestly irritating.

(I don't use ad blockers. I just refuse to visit shitty sites that load up way too many low-quality ads)</comment></comment>


Outlook notifications made easy - <AUTHOR> https://github.com/boudhayan-dev/OutlookNotify <comment><AUTHOR> Hello guys,

I made a script that provides notifications for Outlook mails and Meeting requests. Criticism and suggestions welcome.</comment>


How Did Slack Grow So Fast? - <AUTHOR> https://www.leadboxer.com/blog/how-did-slack-grow-so-fast/ <comment><USER2> I still don't get how Slack got so popular when Hip Chat was already around doing basically the same thing. Both products have 3rd party integration and APIs. Slack still feels unfinished to me, so I don't think they beat Hip Chat on quality. The everyday experience of using both apps are essentially the same.

So my theory is that Slack has influential investors who succeeded in creating hype. Or maybe HipChat did something to screw themselves.

<comment><AUTHOR> I think Slack built a stronger brand by being obsessed with user feedback. This feedback helped make it fun, and not corporate. For example, look at the HipChat homepage versus Slack homepage. Which looks more enjoyable to use?...</comment></comment>


Twitter: "Unlike Trump tweets, Khamenei's 'eliminate Israel' posts are ok" - <AUTHOR> https://twitter.com/Ostrov_A/status/1288453247775256576 <comment><USER2> What do you get when the rule makers (Twitter) implicitly impose rules for different users but decide to stay silent and not enforce those rules when another user breaks them (or even themselves)?

Hypocrickets.</comment>


Horrible - <AUTHOR> http://www.randsinrepose.com/archives/2008/10/06/horrible.html

<comment><USER2> This article finally made me understand why I don't always learn from Rands' essays: he's not a detail person.

When he talks about technical stuff - the Free Electron, Nerd Attention Deficit Disorder - I'm nodding along and he's explaining a ton of reasons for phenomena that I had noticed but didn't understand.

When he talks about manager stuff - I'm the boss for now, What to do when screwed - I don't get it. Because I have only just started doing some management, I can't fill in the blanks of most of the situations he's talking about because I haven't experienced them as a manager.

So, he's kind of like one of those automap things in a computer game - you can see the structure and reasoning to your journey and experiences, but only once you've fucking got there.

</comment><comment><USER3> I was about to write a snarky comment about non-descriptive link titles and then I read the article. It's really good and the non-descriptive headline is (presumably) part of it. ;-)

<comment><USER4> Apparently he didn't want to be great.

</comment></comment><comment><USER5> I just recently discovered, much to my own surprise, that I am in fact not a good businessman. I've got management experience, and I've done that exceptionally in the past, but it turns out that that's not the same as being a good businessperson. I have good ideas about policies and customer service and so on, but I really stink at paperwork and organization and all that kind of stuff.

I need a partner. :-(

</comment><comment><USER6> "whether you're an individual or a manager, your job is to scale at what makes you great"

Great quote from the article, I have always wondered about scaling what I'm good at.

</comment><comment><USER7>
        "You're uniquely good at them and you not quite sure why."

I don't know of anything like that... I know some stuff I'm pretty decent at, but there's thousands that are better than I am at each of them. So how can I "scale at what makes [me] great"?

<comment><USER8> Maybe think of it as uniquely good within your sphere of influence. I'm bottom of the bell curve in generic small talk when you dump me in the middle of a sales conference, but in the context of the IT department I work in, I'm usually put forward first to chat with customers.

<comment><USER5> I tend to think of it as the one-in-one-hundred trait. Given yourself and 99 other random people, what can you do that they probably can't?

That doesn't mean you're the best in your country, or in your field, or in the world, or whatever, it just means that you'll tend to be the best at a lot of small companies, and among the best at the larger ones.

</comment></comment></comment><comment><USER9> Good article, but I still vehemently hate people who turn adjectives into nouns. I can't _have_ a "horrible" therefor I have determined I am perfect at everything.

<comment><USER10> Try reading it as an adjective with an understood noun, kind of in the spirit of an "understood subject."

</comment></comment><comment><USER4> I really have this problem, and I think a lot of other people probably do too. Often things seem obvious to me and I assume the same for everyone else. Consequently, people have a hard time understanding what I'm saying.

To fix this, I really try to analytically break down my idea, which bores people to tears.

Anyone solve this satisfactorily, or do you just find yourself a russian lit major?

<comment><USER11> Try using a lot of cultural metaphors. They can convey a lot of information in a small package, plus they're entertaining to the listener.

Not useful for everything, but for 1 or 2 technical ideas very handy.

<comment><USER4> Thanks, that's a good suggestion. Any specifics you've found useful?

<comment><USER11> It's age and audience-specific, but it used to be you could make references to popular TV shows. With the net anymore that's gotten tougher. Movies are still a good staple for metaphors. As are stip-mall Americana-type references.

For instance I had a project manager (I coach agile teams) that had obviously lost track of her project. She kept coming up with new ways of doing the work, and the team didn't respect her and wouldn't attend meetings.

I was trying to explain to my team what the atmosphere felt like. I finally said "She's like a little girl at Wal-Mart, outside on one of those quarter fire truck rides. She keeps spinning the wheel left and right, desperately going to put out the fire, but the wheel's not connected to anything. She's just frantically spinning away while everybody watches her and smiles" or something like that. It got the point across at a deeper level, I think.

When I teach coupling and cohesion I usually talk about people living in houses -- you want your stuff in your house, and you don't want all the structural members of all the houses connected together, etc

Leaky Abstractions? Gilligan's Island. No matter what the professor or Gilligan made with those coconuts, you just knew it wasn't as reliable as the real thing.

Hope that helps. Kind of hard to come up with stuff without context.

</comment></comment></comment></comment><comment><USER12> Yep, you are your 'Horrible'. Deal.</comment>


Ask HN: What human language features could be useful for the writing of code? - <AUTHOR> Currently, programming languages seem to be largely isolating[0] and invariant rather than inflected[1].
Could operands such as variable names be usefully inflected (probably agglutinatively[2] for simplicity's sake) to indicate type or other contextual constraints?
How about more extensive stacking[3] of operators (an existing example would be += that combines addition and assignment) the way some languages do verbs?
Could we use tenses[4] somehow to make parallel and concurrent programming easier?
Could articles[5] be used to do things like pass variables or instantiate objects?
Anyway, there seem to be opportunities to make programming languages more expressive by borrowing human language features rather than using ever more complex typographical conventions. What do you think?
[0] https://en.wikipedia.org/wiki/Isolating_language
[1] https://en.wikipedia.org/wiki/Inflection
[2] https://en.wikipedia.org/wiki/Agglutinative_language
[3] https://en.wikipedia.org/wiki/Serial_verb_construction
[4] https://en.wikipedia.org/wiki/Grammatical_tense
[5] https://en.wikipedia.org/wiki/Article_(grammar) <comment><USER2> I've been experimenting with various riffs on Common Lisp for about thirty years now, and eating my own dog food. I've found four things that turn out to be huge levers for me:

1\. Python-style iterators. No matter what I want to iterate over, I just write:

        (for item in thing do ...)

or if I want to collect the results:

        (for item in thing collect ...)

2\. A universal binding construct, which I call binding-block or BB for short. It aggressively eliminates parens so that my code ends up looking like:

        (bb var1 (expression)
            var2 (expression)
            ...)

3\. Generic functions, and in particular a set of standard generic functions that perform the most common operations on any data type. For example REF dereferences anything. It replaces ELT, NTH, SLOT-VALUE and AREF and even certain database queries.

4\. Classes, with very light use of inheritance.

For an example of code written in this style, take a look at:

[https://github.com/rongarret/tweetnacl/blob/master/ratchet.l...](https://github.com/rongarret/tweetnacl/blob/master/ratchet.lisp)

You can transfer some of this to other languages, e.g.:

[https://github.com/rongarret/ratchet- js/](https://github.com/rongarret/ratchet-js/)

</comment><comment><USER3> Well I've been working on a language based on Linguistic Universals for like over 10 years. It's called Pyash.

of the things you mentioned, it is analytical rather than isolating, so there is morphological separation between grammatical concepts and stem constructs -- much like in Lojban cmavo vs gismu.

Biggest difference from Lojban and other unnatural programming languages is the use of grammatical cases for denoting parameters.

for instance: "hyikdoka tyutdoyu plostu" which glossed is "one _number _accusative_case, two _number _instrumental_case plus _deonetic_mood", or in colloquial English "Increase the number one by the number two!"

(result is "the number three." or "tyindoka li")

because it has a rich type system which is based on noun-classifiers, a language construct popular in asia, english example is "two dollars of corn" where dollars-of is the noun-classifier for two.

In terms of tenses and concurrency, I have fairly elaborate asynchronous parallel execution model already. but probably could use future tense of scheduling. And the computer could accurately describe it's state by combining tense and grammatical aspect.

articles are generally found in languages that have lost a nominative- accusative case distinction, and can generally be piled up with anaphoric references, i.e. refering to variables.

Here is a paper wrote about it last year: [http://liberit.ca:43110/1DYjc22BP5VkqNLJgr3nQfoGiNLbGFGffG](http://liberit.ca:43110/1DYjc22BP5VkqNLJgr3nQfoGiNLbGFGffG) for slightly more information [http://pyac.ca](http://pyac.ca)

If anyone is interested can put up a more recent paper also.

<comment><USER4> well im certainly interested, sounds absolutely fascinating

<comment><USER3> Good to hear! Here is a paper I wrote begining of this year: [http://liberit.ca:43110/1PLUkrWc9KGrj3d8BaPctpC3CbrXtspHq2/p...](http://liberit.ca:43110/1PLUkrWc9KGrj3d8BaPctpC3CbrXtspHq2/pyashLUKR.html)

</comment></comment></comment><comment><USER5> Have you considered Perl?[0]

[0] [http://world.std.com/~swmcd/steven/perl/linguistics.html](http://world.std.com/~swmcd/steven/perl/linguistics.html)

<comment><USER6> I know Perl has a bad rep for being noisy, but it also has some nifty conventions to make code more rational. For example you can add your `if` condition after your expression or use `unless` rather than an awkward `if (!())` kind of thing.

<comment><USER7> Ruby copied those two, by the way. Useful features.

</comment></comment></comment><comment><AUTHOR> Reference links:

[0] [https://en.wikipedia.org/wiki/Isolating_language](https://en.wikipedia.org/wiki/Isolating_language)

[1] [https://en.wikipedia.org/wiki/Inflection](https://en.wikipedia.org/wiki/Inflection)

[2] [https://en.wikipedia.org/wiki/Agglutinative_language](https://en.wikipedia.org/wiki/Agglutinative_language)

[3] [https://en.wikipedia.org/wiki/Serial_verb_construction](https://en.wikipedia.org/wiki/Serial_verb_construction)

[4] [https://en.wikipedia.org/wiki/Grammatical_tense](https://en.wikipedia.org/wiki/Grammatical_tense)

[5] [https://en.wikipedia.org/wiki/Article_(grammar)](https://en.wikipedia.org/wiki/Article_\(grammar\))

</comment><comment><USER8> I like programming languages much more than natural ones, therefore what usually makes me happy, is to see a language-for-humans to resemble a programming language, like [https://en.wikipedia.org/wiki/Lojban](https://en.wikipedia.org/wiki/Lojban).

But thank you so much for the links! I learned quite a lot from them and now I at least know that the reason I feel German is more similar to Russian, than English, is the thing called "analytic vs. inflected" languages.

</comment><comment><USER9> Pretty much along your line of thinking, check out this 2003 paper by Crista Lopes titled "Beyond AOP: Toward Naturalistic Programming":

[http://www.dourish.com/publications/2003/oopsla2003-naturali...](http://www.dourish.com/publications/2003/oopsla2003-naturalistic.pdf)

Abstract:

> Software understanding for documentation, maintenance or evolution is one of > the longest-standing problems in Computer Science. The use of "high-level" > programming paradigms and object-oriented languages helps, but fundamentally > remains far from solving the problem. Most programming languages and systems > have fallen prey to the assumption that they are supposed to capture > idealized models of computation inspired by deceptively simple metaphors > such as objects and mathematical functions. Aspect-oriented programming > languages have made a significant breakthrough by noticing that, in many > situations, humans think and describe in crosscutting terms. In this paper > we suggest that the next breakthrough would require looking even closer to > the way humans have been thinking and describing complex systems for > thousand of years using natural languages. While natural languages > themselves are not appropriate for programming, they contain a number of > elements that make descriptions concise, effective and understandable. In > particular, natural languages referentiality is a key factor in supporting > powerful program organizations that can be easier understood by humans.

</comment><comment><USER10> Pronouns, for starters. Letting users rephrase commands in order to highlight the most salient pieces is another. More flexible syntax would be good; people are really good at interpreting language, compilers are not nearly so.

<comment><USER11> I know we're in brainstorming mode, so please don't interpret this as criticism of your suggestion.

Don't named variables serve the same purpose as pronouns? What's an example of a pronoun-like usage in a hypothetical programming language?

<comment><USER12> Named variables require the creation of, well, names. Naming things is one of the few hard problems in computer science, and at the extreme ends is single- letter variable names, or variables_that_are_short_phrases, which are annoying to use.

Several languages have usage I'd consider "pronoun-like". Perl has _$__ and Bash has _$?_. Unfortunately, "$?" doesn't exactly roll off the tongue, and there's some truth to criticisms of Perl readability. That may be related to the the quantity of the that it supports though.

 _self_ in various languages supporting OO is a fairly common example of what I'd consider good pronoun-like usage - if I'm inside a method that belongs to a class, what _self_ refers to is accessible and largely unambiguous.

<comment><USER13> See, I hate the use of self, or this in code. We want to specify things exactly in code, and deliberately adding that sort of indirection seems halfway mad. If forced to write classes, I would much rather refer to the class name from within methods, or something similar.

<comment><USER14> This is valid Python:

        >>> class Foo:
        ...    def __init__(Foo, x):
        ...        Foo.x = x
        ...
        >>> foo = Foo(5)
        >>> foo.x
        5

The variable name `self` is a convention as is `cls`. You can name the first argument to a method whatever you please. The same is true for method receivers in Go:

        type Foo struct {
    	X int
        }

        func (Foo Foo) Bar() int {
    	return Foo.X * 2
        }

That will compile and perform as expected. Not sure about Java/C# but in Javascript you can bind `this` to another variable if you'd like:

        var Foo = {
           x: 5,
           foo: function() {
               Foo = this
               return Foo.x * 2;
           }
        }

</comment></comment></comment></comment></comment><comment><USER15> Many programming languages have naming conventions which act as a sort of inflection. Classes may always be capitalized, whereas functions and methods not be. Constants might be written in all caps, while private variables might be preceded by an underscore.

You can draw comparisons between natural language and programming languages just fine. Maybe functions are like verbs and arguments are like the subject. And maybe partial application of a function is like having an intransitive verb. Maybe a decorator is like an adverb and a type constraint is like an adjective.

In general, though, I think the metaphor about programming languages is wrong: programming languages are instructions, not really languages. A programming language should be easy to read out of order more like a magazine than a novel, it should be possible to get a general grasp of what it's doing by glancing at the code, and the code should eliminate ambiguity and uncertainty. Natural languages don't work that way; they're repetitive, vague, and rely on context (social and otherwise).

<comment><USER13> Exactly. The only 'natural language' exercise I can think of that compares with programming is the drafting of legal documents, which also aim to specify something precisely according to a very particular set of definitions.

Unsurprisingly, legal documents have a reputation for being at least as difficult to read as some code.

Natural language, designed for human communication, is, by its nature, unsuitable for precise definition, and a precise language is also unsuitable for human communication.

It really makes sense once you realize how much conversation and prose depend on puns, allegory, allusion, symbols, context, emotion, and so on. All of which are hostile to stating a thing as exactly as possible.

</comment></comment><comment><USER16> There is something along those lines that I've been thinking about: Human languages evolve over time.

Programming languages also change from version to version, but it is the creators of the language making the changes. In human languages, the changes are organically created by the users. Changes that don't end up being useful never take off.

I think it would be practically possible to build a pipeline for this to happen: allow users to extend/modify the language [0][1] and allow those extensions to be shared.

Some languages already have a process for taking popular 3rd party libraries and eventually integrating them into the standard library distributed with the compiler, the same could apply to language modifications.

[0] Modifying the language could involve _removing_ features .

[1] This may need to be more complicated than syntactic macros, which is currently the most common means of extending languages.

<comment><USER17> In terms of the language specification it's the it creators who make the changes. But closer to human languages would be the dialect in use in any given project, often a subset of all the features, combined with conventions for how to use it, what to call things, etc. This might well have evolution similar to human languages.

</comment></comment><comment><USER18> Human language features are, by and large, egregiously detrimental to programming languages.

An expert speaker of one human language can require years, even decades, to become equally proficient in another.

Woe to a programming language which sucks that badly.

</comment><comment><USER19> Great question!

I think we're slowly getting there. First we largely had verbs (procedures) that acted on data somehow. OO added a bit more on the noun side, so we could start to form simple sentences. IMHO much of the appeal of OO is due to this richer "sentence structure", with messages sent to objects.

Of course you could overdo it (see Yegge's _Execution in the Kingdom of Nouns_ [1]), and the FP guys definitely think we overdid it and verbs were fine all along and who needs anything else. Verbs!

Higher Order Messaging[2] adds "adverbs", so we can say something about _how_ those messages are to be delivered. It allows for some very expressive sentences, which you could also describe as crunching architectural patterns. See Sam Adam's great talk[3].

Polymorphic Identifiers[3][4][5] go back to the noun side, adding what you might describe as n noun-phrases, so you can have something more complex that again acts like a noun. Sort of.

Then there's Alistair Cockburn's work[6]

[1] [https://steve-yegge.blogspot.de/2006/03/execution-in- kingdom...](https://steve-yegge.blogspot.de/2006/03/execution-in-kingdom-of- nouns.html)

[2] [https://en.wikipedia.org/wiki/Higher_order_message](https://en.wikipedia.org/wiki/Higher_order_message)

[3] [https://www.hpi.uni- potsdam.de/hirschfeld/publications/media...](https://www.hpi.uni- potsdam.de/hirschfeld/publications/media/WeiherHirschfeld_2013_PolymorphicIdentifiersUniformResourceAccessInObjectiveSmalltalk_AcmDL.pdf)

[4] [https://link.springer.com/chapter/10.1007/978-1-4614-9299-3_...](https://link.springer.com/chapter/10.1007/978-1-4614-9299-3_11)

[5] [https://www.slideshare.net/MarcelWeiher/in- processrest](https://www.slideshare.net/MarcelWeiher/in-processrest)

[6] [http://alistair.cockburn.us/Using+natural+language+as+a+meta...](http://alistair.cockburn.us/Using+natural+language+as+a+metaphoric+base+for+object- oriented+modeling+and+programming)

</comment><comment><USER20> Damian Conway explored some of this topic in "Lingua::Romana::Perligata -- Perl for the XXI-imum Century". See [http://users.monash.edu/~damian/papers/HTML/Perligata.html](http://users.monash.edu/~damian/papers/HTML/Perligata.html) .

</comment><comment><USER21> I dunno linguistics seem mess up programming more, like mixing singular and plural names for fields/variables (customer_name vs customers_name), I always am trying to whittle stuff down to the best descriptors than trying to make it more expressive. Expressive is best in comments. :-)

</comment><comment><USER22> > Could articles[5] be used to do things like pass variables or instantiate > objects?

I wrote about something similar to this (called "type-named objects") in a post last year[1]. The idea is that for small utility methods, you shouldn't have to interrupt your main flow of thought to come up with names for your formal parameters; in fact, you shouldn't even have to name your locals. If you're working in a language with a (perhaps already verbose) static type system, you can just leverage that.

So, for example, instead of this:

      appendNode(node: Node): void {
        this.tail.next = node;
        this.tail = node;
      }

... you can do:

      appendNode(Node): void {
        this.tail.next = the Node;
        this.tail = the Node;
      }

This does introduce some precedence/binding gotchas that I go more into. But that hints towards further improvements. From the aforementioned post, you could end up with a language that allows:

      the ControlMessage's id := defocus

Or, if you add support for "passive voice" to your language:

      id from the ControlMessage := defocus

Completely unrelated, but related to the use of "the", Carmack wrote a tweet[2] that I've got embedded in the comments of a project of mine.

> I have moved to naming global singletons with a The* prefix -- > ThePacketServer, TheMasterServer, TheVoip, etc. Feels pretty good.

Since then, I stopped creating "proper" singletons altogether. Instead, it'd be a quasi-singleton, where I write a `MasterServer` class, and then bless an instance as `TheMasterServer`. Application code will always import, refer to, and otherwise operate on the latter, but tests are free to instantiate their own. This is especially useful if you have implemented some sort of developer switch in the UI that allows you to launch an embedded test harness within a live, running instance of the app. In that case, you don't exactly want your tests to be fiddling with your "real" singleton.

1\. [https://www.colbyrussell.com/2017/02/16/novel-ideas-for- prog...](https://www.colbyrussell.com/2017/02/16/novel-ideas-for- programming.html)

2\. [https://twitter.com/ID_AA_Carmack/status/575788622554628096](https://twitter.com/ID_AA_Carmack/status/575788622554628096)

<comment><USER23> I can't remember the name, but there is a language with type-named parameters. It's an object-oriented language inspired by Java.

It doesn't use "the" \-- it's clear from context whether something is a type name or reference, so you just use "Node". To handle multiple variables of the same type, you can use Node, Node', Node'', etc.

It also supports phrasal methods, where arguments can appear in the middle of the method name. For example, what would be divide(x, y) could be defined as divide(x)By(y) instead.

<comment><USER24> I believe Swift (I think) uses this idea, where the 2nd and subsequent parameters are often named prepositions:

        divideInto(x, by:y, mod:z)

</comment></comment></comment><comment><USER25> Code phonology (vocalization of code) might be a good place to start: [https://news.ycombinator.com/item?id=16554865](https://news.ycombinator.com/item?id=16554865)

</comment><comment><USER26> Maybe some keywords relating to causality/attribution. For instance the word "because", used to express constraints.

"Usury is forbidden due to Sharia law."

Or the modern idiom,

"No universal health care, because _reasons_."

In programming you could do something like

"Foo is constrained because bar", where 'bar' is a set of limitations that are noted elsewhere and can be updated. Not sure if there's really anything new here though, plus it's really just a new keyword not a new linguistic graft.

<comment><USER24> Sounds like Prolog.

</comment></comment><comment><USER27> I would say Python is pretty close to English language, and that's part of why is it so easy to understand. If you write idiomatic Python code it can read like sentences. There are also jokes like "I wrote pseudo code and Python can actually run it". The ternary operator for example is more similar to English grammar than in any other language because it has been constructed with this in mind.

<comment><USER28> Too often do I begin writing pseudo code only to realize that writing valid python is actually quicker. Its sloppy python, but we'll get back to that once the concept is proven.

</comment></comment><comment><USER29> What you are looking for is APL and it's descendents. While you are at it find the paper, "notation as a tool of thought"

</comment><comment><USER30> The biggest one I would say is "context".

It would be nice to avoid repetition in a controlled manner by having some context.

This would make it less tedious having to pass the same arguments to a function over and over again. For example let's say in a web application once you authenticate the user.

In the code that follows you could somehow tell it "by 'user' we mean the current user, by 'query' we mean query the database using the current database connection".

Effectively this would be similar to a transparent auto-wired dependency injection.

The biggest mismatch between human and computer langauges is that we as humans are very context aware.

And the computers are at the other end of the spectrum. Between two different function calls they don't remember or assume anything so we have to keep repeatedly passing stuff to them, what's obvious to us. Which itself increases the bugs because it's a lot easier to make a mistake when you are doing something repetitive 50 times, as opposed to declaring it right once somewhere.

Other useful ones could be having some expressions that are not strictly binary or function calls.

And the ability to define these for custom types.

For example "user is administrator", "1001 (is|is not) palindrome", "100 is divisible by at least 2 of [1, 10, 50]".

Another one, accessing attributes/fields, "firstName of user", "factors of 100", "favoritePosts of user".

Tests about attributes/fields, "if user has twoFactorAuthentication".

Another one, more "space freindly" languages. So you could do "let the thing we are printing := 'test';".

Now let me say I'm fully aware most of what I have said is very difficult if not impossible.

The problem is language complexity and parsing and also composition. The examples I have made don't really hold up in general cases or compose well so it's hard to fit them in general purpose languages.

If we were using projectional structure editors they would be much much easier to achieve. Because we wouldn't have to deal with language rules like that. You could render the program structure in a human friendly way without forcing the computer to parse and understand the same thing.

One of the biggest bottlenecks with programming languages today is that humans and computers are sharing a text based language with each other. And as a result we have to compromise on it to achieve a balance where it's easy enough for the computer to parse and understand and easy enough for humans to read and write.

If we could separate the two we could optimise the languages for ourselves and let the computers use something much more precise and unambigious like binary under the hood that makes them happy.

All much easier said than done.

<comment><USER31> _> a transparent auto-wired dependency injection._

I think you're looking for dynamic scopes. These are annoying for most programming, since you can't just look around nearby the way you can with lexical scopes, you have to figure out what the call stack for the function would look like. When used well, however, they can simplify things considerably.

UNIX environment variables and stdin/stdout/stderr are dynamically scoped. Common Lisp seems to call these 'special variables' and has an "earmuff" convention of putting asterisks around their name to set them off.

<comment><USER18> > _I think you 're looking for dynamic scopes._

Thanks for writing the comment I now don't have to.

</comment></comment></comment><comment><USER32> Probably not when the same word has 5 meanings depending on context.

</comment><comment><USER33> Pronouns/anaphora:

if (x.y.z == 3) delete it

<comment><USER34> If (a == 3) || (b == 4) delete it

Which one?

<comment><USER35> The propositions that are true. If a or b delete it becomes weird when both are true, because in conventional programming languages, b often isn't executed at all, since we don't care about the value of it. However, in this case you do need to execute it because you have to know if delete it reflects on a or both a and b.

<comment><USER24> If you want to delete both if either is true you could write:

      If (a == 3) || (b == 4) delete them

<comment><USER34> what if you want to delete a on the b condition?

<comment><USER24> If there's one condition, use `it`. If there's two, use `this` and `that`, i.e.

      if (a == 3) || (b == 4) delete this //to delete a

and

      if (a == 3) || (b == 4) delete that //to delete b

<comment><USER34> What if there are three?

Also this should refer to the temporally closer element, so your choices are backwards.

<comment><USER24> Instead of `it` for one, and `this` and `that` for two, use `este`, `ese` and `aquel` for three (from the 3-tier pronoun system in Spanish).

Please don't ask what if there's four. Very few (if any) natural languages have more than 3 tiers of demontrative pronouns, so computer languages shouldn't -- if they're using ideas natural language to be more readable. They would use identifiers or numeric subscripts instead.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER36> Narrative.

<comment><USER37> Like this? [http://inform7.com/](http://inform7.com/)

</comment></comment><comment><USER38> > Anyway, there seem to be opportunities to make programming languages more > expressive by borrowing human language features rather than using ever more > complex typographical conventions. What do you think?

I think I'd like to see a single hypothetical example of such an improvement and how it actually improves anything. Things like this usually sound grand, but tend to go nowhere, for obvious reasons.</comment>


Clasp – A Common Lisp with LLVM back end and interoperation with C++ - <AUTHOR> http://drmeister.wordpress.com/2014/09/18/announcing-clasp/ <comment><USER2> >Programmers can expose C++ classes as well as functions and class methods with a single line of code that provides the Clasp name and a pointer to the function/method.

Hellooooo Qt without Smoke bindings.

<comment><USER3> It would be really shiny to have a cross-platform GUI library in CL without grief. I've prodded that space repeatedly in the last 6 years and simply have not come away happy about any of it except LispWork's library.

</comment></comment><comment><USER4> Sounded good until I saw this:

A faster Clasp compiler is coming soon – the current Clasp compiler generates slow native code that is about 100x slower than highly tuned Common Lisp compilers like Steel Bank Common Lisp.

No mention of the expected speedup, but 100x is a huge performance problem.

<comment><AUTHOR> The reason is that Clasp doesn't do Lisp language level optimizations like escape analysis yet. All bindings are stored on the heap and the stack/registers are underutilized. LLVM is a great library for implementing C and C++ but more work needs to be done to support Lisp features like closures and first-class functions. We are working on that now. The goal was first to "make it correct" and now we will "make it fast". Once we have a faster compiler (give us a couple of months) I don't see why it couldn't approach the speed of SBCL (a tall order).

<comment><USER4> Glad to hear it. I've been wondering when new languages would be developed on top of LLVM and it's starting to happen (Julia, now this). C++ is getting a lot of more advanced features, but the syntax is so clunky compared to something like Python for example. I also like the notion of easy C++ library use for things like QT.

</comment></comment></comment><comment><USER5> This is extremely exciting, particularly if it can be made to work with emscripten. Common Lisp in the browser, here we come!

<comment><USER6> Almost certainly can't. The closest you can get is using clicc or ECL or something similar to generate C code, and then compile that with emscripten.

This invokes llvm at runtime, and AFAIK emscripten isn't ported to emscripten.

FWIW, I've tried other lisps under emscripten:

Most lisps generate machine code, store them in RAM, and then execute that RAM. This is not possible under emscripten.

Clisp is a good candidate, since it's byte-code interpreted rather than generating machine code, but clisp makes so many assumptions about how the machine works (in particular it strongly wants a C style stack and does manual stack-pointer manipulation). I actually got fairly far into the bootstrap process under emscripten, but the minimal lisp interpreter it compiles generated bizarre errors.

<comment><AUTHOR> I disagree. Clasp could do this because it compiles Common Lisp to LLVM-IR bitcode files (using COMPILE-FILE) as well as directly to native code using LLVM's MCJIT engine (using COMPILE). emscripten ([https://github.com/kripken/emscripten](https://github.com/kripken/emscripten)) says that it compiles LLVM-IR to JavaScript. I haven't used emscripten, but I believe everything I read on the internet :-) and thus Common Lisp --[Clasp]--> LLVM-IR bitcode files --[emscripten]--> run within browsers.

<comment><USER2> I'm not an expert in Common Lisp internals, but there are some things that don't look like they could be entirely put in an executable without bringing the compiler and runtime along. I'm not just talking about things like a library that outright uses eval, but the more high-level things like macros that call compiled functions and reader macros.

Then again, you might be able to compile the compiler to LLVM IR -> emscripten -> JavaScript, and use that to compile CL code.

<comment><AUTHOR> Agreed, but it's more of a "tree-shaking problem" than anything else. Clasp is written in C++ and Common Lisp. Clasp compiles Common Lisp to LLVM-IR and Clang compiles C++ to LLVM-IR. So theoretically you could compile everything to LLVM-IR and feed that to emscripten. Granted, it's going to be a _huge_ LLVM-IR file. Then you shake out the functions and globals that aren't needed. If the compiler isn't needed then it will shake out (or not be compiled in in the first place). The question for me is "what problem does it solve". I assume there are problems that I'm not aware of that it would solve, otherwise why would someone develop emscripten? Common Lisp is a fantastic language that is really underutilized, it's fun and so expressive. I fell in love with Common Lisp three years ago so deeply that I wrote a new Common Lisp to solve my scientific programming challenges while still being able to make use of powerful C++ libraries. I think everyone should use it everywhere - it's awesome.

</comment></comment></comment></comment></comment><comment><USER7> Exciting work. CL on the LLVM has been needed.

Is this project something that you're doing to support your own research goals in computational chemistry? If so, can you share how this project fits into the bigger picture?

</comment><comment><USER8> Finger crossed then that Azule can get a proper moving GC to work with LLVM then, until then a CL on LLVM (even Julia) are stuck with kinda bad GC.

I wonder why start from scratch for an LLVM backend, can't SBCL be used to generate LLVM code?

<comment><USER9> Is the compacting garbage collector mentioned in the article not a proper moving GC? I am not familiar with it.

<comment><AUTHOR> Yes, the Memory Pool System by Ravenbrook ([https://www.ravenbrook.com/project/mps/](https://www.ravenbrook.com/project/mps/)) is a proper, moving garbage collector. It uses precise GC on the heap and conservative GC on the stack, as does the garbage collector in Steel Bank Common Lisp on x86 chips. I need it because I need my code to run on 100,000 CPU supercomputers with a controlled memory footprint to develop organic nano machines (seriously).

<comment><USER9> To be honest I was just kind of thinking "oh great another language implementation," before I read what you're actually doing and why you needed to create clasp. I appreciate the difficulty of writing precisely GC'd C/C++. It's pretty awesome that you were able to use clang to (I assume this is mainly what the analyzer does) track roots in C & C++ code.

Best of luck.

<comment><AUTHOR> Thanks - yes the analyzer tracks roots through about 300 C++ classes. It also finds global variables and builds C++ code to interface with the MPS library. I exposed the Clang libraries to search the AST and describe the AST in Common Lisp and then wrote the static analyzer in Lisp. I shudder at the thought of doing this all in C++ and I write a lot of complicated stuff like Common Lisp implementations in C++ :-). Common Lisp is the language of trees and pattern recognition. Common Lisp is the perfect tool for this job.

</comment></comment></comment></comment></comment><comment><USER10> I would point out that MOCL [https://wukix.com/mocl](https://wukix.com/mocl) pretty much provides this functionality only with full Common Lisp compatibility. It compiles the CL to C and adds methods to expose your functions to Obj-C / C code (if you want). Works just fine. Builds with Xcode, which as I understand, does everything on/via LLVM.

<comment><USER11> mocl is different from many other implementations: it is a batch compiler for whole programs to C. The generated code does contain a limited evaluator and no compiler. Some dynamic features are gone...

</comment></comment><comment><USER12> > Clasp exposes the Clang AST library and the Clang ASTMatcher library. This > allows programmers to write tools in Common Lisp that automatically analyze > and refactor C++ programs. Clasp can be used to automatically clean-up and > refactor large C++ codebases!

Niiice. I want to program C++, but not in C++.

<comment><AUTHOR> Yes, I'll post more on this and provide example code in the coming weeks on the blog. It's really exciting and it's something that Clasp can do right now even though the Clasp compiler isn't a highly optimizing one yet. Google uses automated Clang refactoring to clean up the googleplex (100 megaLOC). Clasp puts those capabilities into everyones hands now.

</comment></comment><comment><USER13> Wow, this news almost makes me drool. I will keep my eye on that. I'm on SBCL right now, but I can't wait to see what Lisp can do with LLVM...

</comment><comment><USER14> I hope it turns out a good implementation since there is a lot of C++ code out there and I do not know C++. But I can comprehend Lisp.

</comment><comment><USER15> Maybe not-so-related, but "clasp" is also the name of a pretty popular Answer Set Programming (ASP) solver (link [http://www.cs.uni- potsdam.de/clasp](http://www.cs.uni-potsdam.de/clasp)).

</comment><comment><USER16> The name is already taken unfortunately: [http://www.cs.uni- potsdam.de/clasp/](http://www.cs.uni-potsdam.de/clasp/)

      Package: clasp
      Version: 3.1.0-1
      Description-en: conflict-driven nogood learning answer set solver
      clasp is an answer set solver for (extended) normal logic
     programs.

<comment><USER17> It was also already taken by a device for fastening things. And my name was already taken by at least three people before me. Somehow we all get along.

<comment><USER16> Package names in distributions have to be unique though, so this one will probably have to be called clasp-llvm or something like that.</comment></comment></comment>


Ask HN: Any good app for downloading tech articles? - <AUTHOR> Sometimes you are going away for a weekend but want to do some brush up on a tech topic such as react or some specific iOS/ android topic. Is there an easy way to download a bunch of medium or articles and read them offline? does anyone else have this problem? <comment><USER2> Instapaper (no longer available in Europe) or [https://getpocket.com/](https://getpocket.com/) have bookmarklets for browsers. Their mobile apps sync the full article HTML and you can read them later offline.

</comment><comment><USER3> I am using FREE version of "Local Website Archive " from [https://www.aignes.com/lwa.htm](https://www.aignes.com/lwa.htm)

Free version provides me all things I want.</comment>


Early tech investor says Bitcoin will be bigger than the internet - <AUTHOR> https://www.cnbc.com/2018/04/23/early-tech-investor-says-bitcoin-will-be-bigger-than-the-internet.html?__source=yahoo%7Cfinance%7Cheadline%7Cstory%7C&par=yahoo&yptr=yahoo <comment><USER2> > In five years you are going to try to go buy coffee with fiat currency and > they are going to laugh at you because you're not using crypto

There isn't a version of a universe where I can imagine this happening so quickly. If he truly believes this will be the case, then he must be living in some echo chamber.</comment>


Cancers Might Be Newly Evolved Species - <AUTHOR> http://news.discovery.com/animals/cancers-could-be-new-species-110727.html <comment><USER2> Excerpt:

 _The idea is already gaining support from other experts. Mark Vincent, a medical oncologist at the London Regional Cancer Program and University of Western Ontario, said, "I think Duesberg is correct by criticizing mutation theory, which sustains a billion-dollar drug industry focused on blocking these mutations. Yet very, very few cancers have been cured by targeted drug therapy, and even if a drug helps a patient survive six or nine more months, cancer cells often find a way around it."_

I'm not really liking a lot of what the article says but I liked the above quote. Personally, I tend to think most cancers probably have a viral origin. Virii, like the ones that cause warts or cold sores, are well known to insert themselves into cells and thereby create "growths". Off the top of my head, I don't know of anything else which is known to do something similar. And we know human papilloma virus plays a role in cervical cancer (which is why so many women get annual pap smears).</comment>