Tweeting Fortran

I started tweeting Fortran basics @FortranTip 3 days ago. There are 111 followers so far, due to a mention by @fortranlang. Using the Carbon app one can paste pictures of code and evade Twitter’s 280 character limit. Using TweetDeck, it is possible for several people to share a Twitter account. Once I get through most of Fortran 95, maybe others could tweet about more recent and advanced Fortran features. There are many Fortran online tutorials, but there is some demand for technical information pushed to cell phones in small increments. @scipytip has 132K followers.

15 Likes

Thanks @Beliavsky for doing that. I think you have uncovered an opportunity and pursued it!

Thanks also for creating a specific (distinct) logo for this twitter account.

An account like this requires dedication, one has to have interesting content “forever”. On this note, if there is anybody interested in helping posting interesting content at https://twitter.com/lfortranorg for LFortran related news, or updates or just facts, let me know. Or even if you have tips what kind of content would be good to post there.

4 Likes

I’d be happy to tweet some of my tips.

8 Likes

A few I would like to see …

  • writing to stderr
  • Row-Column storage and reading and printing values in row-column order
  • scratch files
  • comparing arrays (ALL() or ANY())
  • OOPS: contained procedures and accidently changing values in the
    parent scope
  • OOPS: Passing constants to a subprogram and modifying them on some
    systems
  • Non-advancing I/O versus stream I/O
  • Different-length strings in array constructors, functions like MERGE(),
  • OOPS: Using floating-point comparisons tests
  • OOPS: Roundoff pitfalls such as assigning a real to an integer,
    using MOD with REAL arguments, assigning a constant value
    without a type like A=1234567.0 ! sans d0 suffix
  • Avoiding manual allocate and deallocate (and why pointers should be only
    used when you cannot think of anything else)
  • OOPS: Overflow
  • OOPS: Letting array indexes go out of bounds
  • OOPS: (Lack of) short-circuiting and making bad
    assumptions about the computing order of subexpressions
  • Empty array constructor such as ints=[integer ::]
  • exiting a multi-nested loop
7 Likes

Thanks for setting this up @Beliavsky! I thought I knew Fortran pretty well but I’m learning new stuff from your tweets :grin:

I’d be happy to contribute tweets. Maybe if you get a lot of volunteers it would be an idea to set up a database/spreadsheet for people to add their tweet ideas to, and then you can moderate the content and post frequency? Just a thought.

I know some of the more popular channels like this recycle content (there’s probably some automation going on in the background). Not necessarily suggesting it here, but it’s worth remembering if you/we are struggling to think of new tweets.

1 Like

Just spotted your GitHub repo associated with this - maybe that could take the place of the database/spreadsheet I suggested.

1 Like

Nice! I’ll use it as a test cases for LFortran to ensure they all compile and work.

2 Likes

I have added @samharrison7 and @DoctorFortran aka @sblionel (who earlier offered to share tips) as contributors. Please try it out. There is no strict rule about tweet frequency, but I think 1 to 3 tweets per day is a reasonable pace. At the beginning I was tweeting too much.

Thanks! I’ll give it a go when I think of a good tip or two (and figure out how to use TweetDeck :wink:)

Thanks for the great list. I have made them issues. People can use issues to add tip suggestions and/or contribute tips. I would give credit for any tips posted.

I sent my first tweet :grin: Nothing too profound yet…

4 Likes

Thanks a lot @Beliavsky for doing this. I think it would be nice to see some features of modern Fortran advertised. Quite often I have the feeling that Fortran is considered an old-fashioned language because many ppl still think of FORTRAN 77. Just to give an example, I recently retweeted something from @fortranlang and someone replied “Why Fortran in 2021” :slight_smile:

2 Likes

It would also be nice to discuss how to call Fortran from Julia or Matlab (but this might be too specialized maybe)

1 Like

Anything that would interest a good fraction of Fortranners is fine, and those topics would. The tweet of @samharrison7 comparing Fortran and NumPy got 67 likes. Mentioning other languages in a constructive way attracts users of those languages, especially if someone from a different language community retweets a Fortran tip.

5 Likes

This is a great idea. I will contribute to the extent my knowledge and time allow me. I suggest supplying each tweet with a link to the corresponding example in the GitHub repository. This would allow easy copy/paste and test of the codes by people. Ideally, it could be a permanent link to an online compiler with the code written and ready to compile there for exploration. But I do not know if any online compiler platforms currently offer such a capability.

2 Likes

Thanks. I posted one of your tips, and you can now tweet @FortranTip directly using TweetDeck

I added an index of tweets with links to codes, which will be updated going forward.

Intel Fortran Compiler (ifx) 9:52 AM · Dec 27, 2021
Doubled delimiter in a string is regarded as a single character of the constant 7:07 AM · Dec 27, 2021 code
Store data as an array of derived types or a derived type with array components? 9:55 AM · Dec 26, 2021 code
Fortran is column-major 4:22 AM · Dec 26, 2021 code
CMPLX should be used with a KIND argument 6:30 PM · Dec 24, 2021 code

Links to GitHub on Twitter are too big and ugly IMO, and they use up 23 characters, but I may include them in posts if there is space.

1 Like

Fantastic. thanks for the links and the invitation. It may take me a while to learn TweetDeck. Anything I decide to contribute will be first submitted as a PR to the GitHub repository.

1 Like

@Beliavsky and co., I started a website compiling the FortranTip tips, currently viewable at https://zmoon.github.io/FortranTipBrowser/.

9 Likes

The syntax highlighting of FortranTip is amazing, much better than that of Fortran Discourse. Is it possible to improve the syntax highlighting of Fortran Discourse, such as to add more colors and make the fonts more slender?

Impressive work. Thanks for doing this. The design goes well beyond what I imagined on Dec 21. Ideally, the tweets should also provide links to the corresponding pages on this website, further directing people to the relevant testing and GitHub platforms.

1 Like