# Has anyone seen this blog?

**URL:** <https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684>\
**Category:** Community\
**Tags:** question\
**Created:** [January 30, 2018, 4:34am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684 "2018-01-30T04:34:22Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [February 4, 2018, 3:14am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/41 "2018-02-04T03:14:41Z")

</div>

Thanks for the clarification the use of #= and =# about comments.

> [@ScottPJones](#):
>
> There were already multiple alternatives to @printf available when he wrote his blog, such as Lin Dahua’s Formatting package, or my own StringUtils package (which has been superceded by StringLiterals). You could mention that.

Good suggestion. I will update the blog accordingly.

> [@ScottPJones](#):
>
> About unit testing, we also used FactCheck (you have a mispelling, FastCheck, twice in your blog), until most of it’s features were added to Base.Test, and development/maintenance on FactCheck seemed to stop, at which point we switched over to Base.Test.

Fixed typo.

> [@ScottPJones](#):
>
> What did you mean by saying there were 8,219 lines of Scheme, and 2,286 lines of Lisp?
> 
> There’s only FemtoLisp, which is an implementation/dialect of Scheme (that Jeff Bezanson wrote)
> 
> FemtoLisp is used for both the parsing (converting Julia text into an Expr), and for “lowering” (dealing with macros, etc).

My counting is naively basic.

```julia
$ find . -type f -name '*.scm' | xargs wc -l |grep total
  8219 total
$ find . -type f -name '*.[ch]' | xargs wc -l |grep total
  68808 total
$ find . -type f -name '*.[cpp]' | xargs wc -l |grep total
  54126 total
$ find . -type f -name '*.*lsp*' | xargs wc -l |grep total
 2286 total

```

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 4, 2018, 3:18am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/42 "2018-02-04T03:18:44Z")

</div>

Thanks for stepping in to set things right!

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [February 4, 2018, 4:15am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/43 "2018-02-04T04:15:27Z")

</div>

> [@ScottPJones](#):
>
> Lin Dahua’s Formatting package

I tried the following code and it ends up with 68 lines of native instructions. That’s very good compared to the 500+ instructions that the original blog claimed.

```julia
@code_native Formatting.printfmt("{1:>4s} {2:.2f}", "abc", 12)

```

I don’t quite understand, however, why it could be so much simpler in C. I just copied the instructions from that blog below. It almost seems that the it does nothing except calling another function (see the `jmp` instruction at the end).

```asm
f:
.LFB23:
	.cfi_startproc
	movq	%rsi, %r8
	movl	$.LC0, %ecx
	movq	$-1, %rdx
	movl	$1, %esi
	movl	$1, %eax
	jmp	__sprintf_chk
	.cfi_endproc

```

I have reproduced this on my mac. It turns into 21 lines of instructions:

```julia
$ cat test.c
#include <stdio.h>

void f(char *buffer, const char *a, double b) {
  sprintf(buffer, "this is a %s %g", a, b);
}

$ gcc -g -c -o test.o test.c
$ objdump -d -S test.o

test.o:	file format Mach-O 64-bit x86-64

Disassembly of section __TEXT,__ text:
_f:
; void f(char *buffer, const char *a, double b) {
       0:	55 pushq	%rbp
       1:	48 89 e5 movq	%rsp, %rbp
       4:	48 83 ec 20 subq	$32, %rsp
       8:	31 c0 xorl	%eax, %eax
       a:	48 8d 0d 33 00 00 00 leaq	51(%rip), %rcx
      11:	48 c7 c2 ff ff ff ff movq	$-1, %rdx
      18:	48 89 7d f8 movq	%rdi, -8(%rbp)
      1c:	48 89 75 f0 movq	%rsi, -16(%rbp)
      20:	f2 0f 11 45 e8 movsd	%xmm0, -24(%rbp)
; sprintf(buffer, "this is a %s %g", a, b);
      25:	48 8b 7d f8 movq	-8(%rbp), %rdi
      29:	4c 8b 45 f0 movq	-16(%rbp), %r8
      2d:	f2 0f 10 45 e8 movsd	-24(%rbp), %xmm0
      32:	89 c6 movl	%eax, %esi
      34:	b0 01 movb	$1, %al
      36:	e8 00 00 00 00 callq	0 <_f+0x3B>
; }
      3b:	89 45 e4 movl	%eax, -28(%rbp)
      3e:	48 83 c4 20 addq	$32, %rsp
      42:	5d popq	%rbp
      43:	c3 retq

```

**_Update:_** added assembly code compiled from `sprintf` C code.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 4, 2018, 7:12am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/44 "2018-02-04T07:12:28Z")

</div>

can you please provide a link? I can’t find it.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 4, 2018, 7:16am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/45 "2018-02-04T07:16:21Z")

</div>

No, with Hacker News you want to search for it otherwise it removes upvotes if they all come from the same link. Just search for Julia and sort by date.

---

<div class="post-metadata">

**Author:** ![NickNack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nicknack/32/1792_2.png) [@NickNack](https://discourse.julialang.org/u/NickNack)\
**Post date:** [February 4, 2018, 10:02am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/46 "2018-02-04T10:02:56Z")

</div>

> [@ChrisRackauckas](#):
>
> I posted it to Hacker News. Please go search and upvote it to give awareness.

Done. For convenience, here is a link to search results for this item at Hacker News. To see the upvote arrow, click on the “ points” or “[y] comments” links under the title. Please let me know if using this link will remove upvotes; if so I’ll delete it.

> **[HN Search powered by Algolia](https://hn.algolia.com/?query=julia%20updated%20analysis&sort=byPopularity&prefix&page=0&dateRange=all&type=story)**
>
> Hacker News Search, millions articles and comments at your fingertips.

But if we want it to climb up Google’s page rankings I think it needs to be cross-posted a lot more. Any suggestions for other sites can we post it on?

EDIT: Added instructions for how to find the upvote arrow.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 4, 2018, 10:10am UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/47 "2018-02-04T10:10:52Z")

</div>

FWIW, github also gives some percentages and a nice visualization:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/0/40bcae9e115fbb3a76d4171d22491a5170a76989.png)

They seem to use the [Linguist library](https://github.com/github/linguist) (see [here](https://help.github.com/articles/about-repository-languages/)).

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 4, 2018, 3:13pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/48 "2018-02-04T15:13:18Z")

</div>

If it hits Hacker News’ front page, it will be cross posted a ton. We need to make sure it gets enough votes quick enough to do this.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 4, 2018, 5:13pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/49 "2018-02-04T17:13:13Z")

</div>

Something is killing the ranking since it got up to 30 points but still isn’t seen near the front pages… probably needs some comments too.

---

<div class="post-metadata">

**Author:** ![pablosanjose](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pablosanjose/32/7006_2.png) [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Post date:** [February 4, 2018, 5:24pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/50 "2018-02-04T17:24:46Z")

</div>

Done

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [February 4, 2018, 5:31pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/51 "2018-02-04T17:31:32Z")

</div>

It looks like longer comments give points - not sure exactly how their ranking works, but I upvoted it, and that gave a point, and then made a long comment, and that gave another point (or it could be, that only the first comment by a person gives a point)

---

<div class="post-metadata">

**Author:** ![pablosanjose](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pablosanjose/32/7006_2.png) [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Post date:** [February 4, 2018, 5:37pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/52 "2018-02-04T17:37:17Z")

</div>

I suspect it’s the latter

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 4, 2018, 5:49pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/53 "2018-02-04T17:49:54Z")

</div>

I assume time might be the penalizer (compare point to time ratio of articles in the top 30). I’d guess we’d need about 200 votes given that the post is about 15 hours old. But I might as well be wrong here.

EDIT: The article below boils down to

> Score = (P-1) / (T+2)^G
> 
> where,  
> P = points of an item (and -1 is to negate submitters vote)  
> T = time since submission (in hours)  
> G = Gravity, defaults to 1.8 in news.arc

> **[How Hacker News ranking algorithm works](https://medium.com/hacking-and-gonzo/how-hacker-news-ranking-algorithm-works-1d9b0cf2c08d)**
>
> In this post I’ll try to explain how the Hacker News ranking algorithm works and how you can reuse it in your own applications. It’s a very…

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 4, 2018, 6:00pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/54 "2018-02-04T18:00:17Z")

</div>

While Hacker News is read by many people, I think the ultimate goal is to make this rebuttal show up in search engines. For that, mentioning it in blogs etc may work.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [February 4, 2018, 6:55pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/55 "2018-02-04T18:55:49Z")

</div>

I ended up using [cloc](https://github.com/AlDanial/cloc) to count lines of code so it’s more accurate. I also had the wrong stats previously (silly mistake for not checking out the branch properly so the previous stats were from `master` instead.)

Stats from Julia release-0.6 branch below. I intentionally include specific languages to avoid noises e.g. there are many single-file language stat from the microbenchmarks. I will update my blog shortly.

```julia
$ cloc --out=/tmp/julia-cloc-subset.txt --include-lang=Julia,C,C++,Scheme,Lisp,"C/C++ Header" .

$ cat /tmp/julia-cloc-subset.txt 
github.com/AlDanial/cloc v 1.74 T=10.90 s (66.3 files/s, 28974.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Julia 556 27690 16987 175147
C 86 4292 4316 41455
C++ 21 1529 2356 18491
C/C++ Header 43 1393 1578 10748
Scheme 11 566 669 6369
Lisp 6 288 97 1901
-------------------------------------------------------------------------------
SUM: 723 35758 26003 254111
-------------------------------------------------------------------------------

```

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [February 4, 2018, 7:02pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/56 "2018-02-04T19:02:16Z")

</div>

You should fix that column about Lisp, those are just Scheme (FemtoLisp) files, FemtoLisp accepts both `*.scm` and `*.lsp` for source files, and if you look at the files themselves, you will see:

```julia
14:00 $ more compiler.lsp
; -*- scheme -*-

```

i.e. they are tagged as being Scheme.

---

<div class="post-metadata">

**Author:** ![mschauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mschauer/32/13946_2.png) [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Post date:** [February 4, 2018, 7:03pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/57 "2018-02-04T19:03:00Z")

</div>

> Backgroud

Small thing, but as it is in a headline I thought I mention it.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [February 4, 2018, 7:24pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/58 "2018-02-04T19:24:53Z")

</div>

Good point… although Jeff Bezanson calls it a scheme-liked lisp implementation. Do we call it scheme, lisp, or somewhere in between? 😉

[https://github.com/JeffBezanson/femtolisp](https://github.com/JeffBezanson/femtolisp)

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [February 4, 2018, 7:45pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/59 "2018-02-04T19:45:04Z")

</div>

It’s closer to Scheme than other dialects of Lisp (I believe Jeff studied under Gerald Sussman - who was also one of the 3 professors on the panel when he defended his Ph.D. thesis)  
Lisp’s are basically balls of mud anyway 😀

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [February 4, 2018, 7:50pm UTC](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684/60 "2018-02-04T19:50:24Z")

</div>

I’ve updated my blog and just called it Femtolisp, which should be the most accurate description.

[Previous page](https://discourse.julialang.org/t/has-anyone-seen-this-blog/8684.md?page=2)
