[Rd] [OT] Re: a question about optim.R and optim.c in R

Dirk Eddelbuettel edd at debian.org
Tue Jul 8 14:56:26 CEST 2014


(flagged thread as OT as this is now orthogonal to the OP's question)

On 8 July 2014 at 08:41, Prof J C Nash (U30A) wrote:
| Side comment: At UseR last week, Yihui Xie sat with me and we
| implemented a Fortran language engine for knitr. It looks like a Pascal
| one may also be possible, and maybe even a BASIC (though that may need
| variants for different platforms).

I am not so sure. If you look at what Yihui actually did (ie: enable Fortran
support which R already had -- and you can actually _run_ the code) then you
may see that Pascal and (gasp) Basic have a different status _as they cannot
be used to extend R_.  So where are talking "just typesetting". So read on.

| This would allow vignettes to
| document some of the legacy code to be written, and that may be an
| important matter as the expertise for such older tools moves into
| retirement. Off-list communication about such ideas welcome.

As I mentioned to you at useR, knitr has had the ability to just call
highlight as an external 'engine' for a long time (and that may have been
added after I prodded Yihui when I needed to typeset some Matlab and/or
Python code).  

Below is the output from 'highlight -p' --- we do already have support for a
fairly large number of languages.  Pascal is among them, as are some old
enough to be of interest to you. Algol 68, maybe?  ;-)

Dirk


edd at max:~$ highlight -p

Installed language definitions (located in /usr/share/highlight/langDefs/):

ABAP/4                        : abap4 ( abp )
ABC                           : abc
Advanced Backus-Naur Form     : abnf
Action Script                 : actionscript ( as )
ADA95                         : ada ( a adb ads gnad )
Agda                          : agda
ALGOL 68                      : algol ( alg )
AMPL                          : ampl ( dat run )
AMTrix                        : amtrix ( hnd s4 s4h s4t t4 )
AppleScript                   : applescript
Arc                           : arc
ARM                           : arm
AS/400 CL                     : as400cl
ASCEND                        : ascend ( a4c )
ASP                           : asp ( asa )
Abstract                      : aspect ( was wud )
Assembler                     : assembler ( asm )
Applied Type System           : ats ( dats )
AutoHotKey                    : autohotkey ( ahk )
AutoIt                        : autoit ( au3 )
Avenue                        : avenue
(G)AWK                        : awk
DOS Batch                     : bat ( cmd )
BBcode                        : bbcode
BCPL                          : bcpl
BibTeX                        : bibtex ( bib )
Biferno                       : biferno ( bfr )
Bison                         : bison ( y )
Blitz Basic                   : blitzbasic ( bb )
BM Script                     : bms
Backus-Naur Form              : bnf
Boo                           : boo
C and C++                     : c ( c++ cc cpp cu cxx h hh hpp hxx )
Ceylon                        : ceylon
Charmm                        : charmm ( inp )
CHILL                         : chill ( chl )
Clean                         : clean ( icl )
ClearBasic                    : clearbasic ( cb )
Clipper                       : clipper
Clojure                       : clojure
Clips                         : clp
COBOL                         : cobol ( cbl cob )
ColdFusion MX                 : coldfusion ( cfc cfm )
C#                            : csharp ( cs )
CSS                           : css
D                             : d
Diff                          : diff ( patch )
Dylan                         : dylan
Extended Backus-Naur Form     : ebnf
Eiffel                        : eiffel ( e se )
Erlang                        : erlang ( erl hrl )
Euphoria                      : euphoria ( eu ew ex exw wxu )
Express                       : express ( exp )
FAME                          : fame ( fame )
Felix                         : felix ( flx )
Fortran 77                    : fortran77 ( f for ftn )
Fortran 90                    : fortran90 ( f90 f95 )
Frink                         : frink
F#                            : fsharp ( fs fsx )
Java FX                       : fx
Gambas                        : gambas ( class )
Go                            : go
Graphviz                      : graphviz ( dot )
Haskell                       : haskell ( hs )
haXe                          : haxe ( hx )
Hecl                          : hcl
HTML                          : html ( htm xhtml )
Apache Config                 : httpd
Icon                          : icon ( icn )
IDL                           : idl
Interactive Data Language     : idlang
Lua (for LuaTeX)              : inc_luatex
Informix                      : informix ( 4gl )
INI                           : ini
Inno Setup                    : innosetup ( iss )
INTERLIS                      : interlis ( ili )
IO                            : io
Jasmin                        : jasmin ( j )
Java                          : java ( groovy grv )
Javascript                    : js
JSP                           : jsp
LDAP                          : ldif
Haskell LHS                   : lhs
Lilypond                      : lilypond ( ly )
Limbo                         : limbo ( b )
Linden Script                 : lindenscript ( lsl )
Lisp                          : lisp ( cl clisp el lsp sbcl scom )
Logtalk                       : logtalk ( lgt )
Lotos                         : lotos
Lotus                         : lotus ( ls )
Lua                           : lua
Luban                         : luban ( lbn )
Make                          : make ( mak mk )
Maple                         : maple ( mpl )
Matlab                        : matlab ( m )
Maya                          : maya ( mel )
Mercury                       : mercury
Miranda                       : miranda
Modula2                       : mod2 ( def mod )
Modula3                       : mod3 ( i3 m3 )
Modelica                      : modelica ( mo )
MoonScript                    : moon
MaxScript                     : ms
MSSQL                         : mssql
Magic eXtensible Markup Language: mxml
Notation3 (N3), N-Triples, Turtle, SPARQL: n3 ( nt ttl )
Nasal                         : nasal ( nas )
NeXT Byte Codes               : nbc
Nemerle                       : nemerle ( n )
NetRexx                       : netrexx ( nrx )
Nice                          : nice
NSIS                          : nsis ( nsi )
Not eXactly C                 : nxc
Oberon                        : oberon ( ooc )
Objective C                   : objc
Objective Caml                : ocaml ( ml mli )
Octave                        : octave
Open Object Rexx              : oorexx
Object Script                 : os
Oz                            : oz
Paradox                       : paradox ( sc )
Pascal                        : pas
Perl                          : perl ( cgi perl pl plex plx pm )
PHP                           : php ( php3 php4 php5 php6 )
Pike                          : pike ( pmod )
PL/1                          : pl1 ( bdy ff fp fpp rpp sf sp spb spe spp sps wf wp wpb wpp wps )
PL/Perl                       : plperl
PL/Python                     : plpython
PL/Tcl                        : pltcl
POV-Ray                       : pov
Prolog                        : pro
Progress                      : progress ( i p w )
PostScript                    : ps
Microsoft PowerShell          : ps1
PATROL                        : psl
Pure                          : pure
Pyrex                         : pyrex ( pyx )
Python                        : python ( py )
Qore                          : q
QMake Project                 : qmake
Qu                            : qu
R                             : r
Rebol                         : rebol
Rexx                          : rexx ( rex rx the )
Relax NG                      : rnc
RPG                           : rpg
RPL Programming Language      : rpl
Ruby                          : ruby ( pp rb rjs ruby )
PowerPC Assembler             : s
SAS                           : sas
Scala                         : scala
Scilab                        : scilab ( sce sci )
Bash                          : sh ( bash ebuild eclass )
SMALL                         : small ( sma )
Smalltalk                     : smalltalk ( gst sq st )
Standard ML                   : sml
SNMP                          : snmp ( mib smi )
SNOBOL                        : snobol ( sno )
RPM Spec                      : spec
SPIN SQL                      : spn
PL/SQL                        : sql
Squirrel                      : squirrel ( nut )
Sybase SQL                    : sybase
Tcl/Tk                        : tcl ( itcl wish )
TCSH                          : tcsh
Regex tests                   : test_re
TeX and LaTeX                 : tex ( cls sty )
Transact-SQL                  : tsql
TTCN3                         : ttcn3
Plain text                    : txt ( text )
UPC (and C, technically)      : upc
Vala                          : vala
Visual Basic                  : vb ( bas basic bi vbs )
Verilog                       : verilog ( v )
VHDL                          : vhd
XML                           : xml ( dtd ecf ent hdr hub jnlp nrm resx sgm sgml svg tld vxml wml xsd xsl )
SuperX++                      : xpp
Yaiff                         : yaiff
Zonnon                        : znn

Use name of the desired language with the --syntax option.

edd at max:~$ 

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-devel mailing list